I have a scheduled handler that checks of certain contacts have changed in a specific period. When a change is detected the handler will send a ContactUpdated event for each changed contact.
The events are being handled, but they are all in the same conversation. This creates a big visual tree in ServiceInsight and Application Insight), which I’m not interested in.
With any of the other methods any message send via IMessageSession should result in a whole new conversation identifier as there is no previous message.
I think you’re stating that all scheduled invocations all share the same conversation identifier which to me also feels like unwanted behavior.
For me too, but if I recall I couldn’t even set the header with a new conversation id. NServiceBus is actively fighting me on this, so I was ‘is there some bad practice that I’m missing’.
Thanks for raising an issue!
No. I’m using timer-triggered Azure Functions (which I think you should add as an alternative in the documentation :-). They work great!)
In this context, being scheduled is not important. I just wanted to explain the use case.
A scheduled Azure Function sends periodically a CheckForUpdatedContacts command to an NServiceBus endpoint. This endpoint handles the command by checking for updates and publishing ContactUpdated event for each updated contact.
The CheckForUpdatedContacts command is the start of the conversation, but all ContactUpdated events join this conversation. In this context the ContactUpdated event should start its own conversation, because I’m not interested in the check trigger.