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

Allow dispatcher to batch multiple isolated dispatches per destination #857

Open
danielmarbach opened this issue Aug 9, 2023 · 0 comments

Comments

@danielmarbach
Copy link
Contributor

danielmarbach commented Aug 9, 2023

Multiple isolated dispatches (possible when the outbox is at play with a handler or a transactional session that sends multiple messages) can be batched for efficiency reasons as explained in

// Changing the dispatch consistency to be isolated to make sure the transport doesn't
// enlist the operations in the receive transaction. The transport might still want to batch
// operations for efficiency reasons but should never enlist in the incoming transport transaction.
// Otherwise a failure to ACK the incoming message after Outbox storage has been set to Dispatched
// would result in outgoing message loss.

https://github.com/Particular/NServiceBus/blob/master/src/NServiceBus.Core/Reliability/Outbox/ForceBatchDispatchToBeIsolatedBehavior.cs#L14-L19

For efficiency reasons it would be possible to change the dispatcher to account for those scenarios instead of doing individual broker calls as long as those operations are not enlisted in the receive transaction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant