Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New API to allow starting a new conversation #5693

Merged
merged 2 commits into from
Aug 4, 2020

Conversation

mikeminutillo
Copy link
Member

@mikeminutillo mikeminutillo commented Jul 24, 2020

An API to trigger a new conversation. This can be useful in a few scenarios:

  • A long-running saga based scheduler.
  • An integration handler that loads records and then starts a new process for each record.
var sendOptions = new SendOptions();
sendOptions.StartNewConversation();
// or
// sendOptions.StartNewConversation("CustomConversationId/"+Guid.NewGuid());
await context.Send(new PlaceOrder(), sendOptions);

This will override the conversation Id for an outgoing message.

  • If a conversation id is supplied, use it
  • If no conversation id is supplied, generate one using the configured conversation id strategy
  • If a new conversation is started in the context of a message hander, the original conversation id is stored in a new NServiceBus.PreviousConversationId header.
  • If a new conversation is started using this API, any attempt to set the ConversationId header manually causes an exception.

@mikeminutillo
Copy link
Member Author

Raised a couple of issues in ServiceInsight to:

@mikeminutillo mikeminutillo marked this pull request as ready for review July 29, 2020 02:17
@mikeminutillo mikeminutillo added this to the 7.4.0 milestone Jul 29, 2020
@mikeminutillo mikeminutillo merged commit 1ed13c4 into master Aug 4, 2020
@mikeminutillo mikeminutillo deleted the new-conversation-api branch August 4, 2020 03:33
@HEskandari HEskandari changed the title API to start new conversation New API to allow starting a new conversation Aug 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow override of existing conversation ID
2 participants