I’ve updated my sample (main branch) with code (under Sample2 folder) to reproduce the issue I am seeing.
The code (like my real-world code) transforms the EnclosedMessageTypes header for outgoing messages to only use the type full name rather than FQDN. It’s also using the
NetwonsoftSerializer, hence why we see JObject errors rather than something XML-like.
Steps to replicate a working process:
- Start multiple projects for SampleClient and SampleEndpoint under the Sample2 folder.
- Focus on SampleClient window and press Enter to send a StartOrder message to the SampleEndpoint endpoint.
- Wait 10 seconds, SampleEndpoint should output details about the order being cancelled having processed the OrderTimeout message.
Steps to replicate error:
4. Repeat previous step 1 and 2, and just after the SampleEndpoint receives the StartOrder message, close the debug session to stop the processes.
5. Wait any amount of time (doesn’t matter if timeout has passed), and repeat step 1 to start the SampleEndpoint again. At this point the OrderExpired timeout will be processed immediately or wait till the expiry and then process. Either way, the message cannot be deserialized.
As a further test, if the code that registers the PublishFullTypeNameOnlyBehavior is removed/commented and all the steps repeated, no exception occurs.
Any ideas why a process restart would cause the issue?