Remove forced DispatchConsistency.Isolated for outbox operations#7604
Open
Remove forced DispatchConsistency.Isolated for outbox operations#7604
Conversation
Contributor
|
@copilot try again |
Copilot stopped work on behalf of
danielmarbach due to an error
January 31, 2026 06:39
This change removes the ForceBatchDispatchToBeIsolatedBehavior and changes the dispatch consistency from Isolated to Default when dispatching outbox operations. This allows transports like Azure Service Bus and Amazon SQS to use batching for better performance and lower costs. The behavior was originally added to prevent operations from being enlisted in the receive transaction, but this is already guaranteed by the outbox forcing TransportTransactionMode.ReceiveOnly, which by definition prevents outgoing messages from being enlisted in the receive transaction. Co-authored-by: danielmarbach <174258+danielmarbach@users.noreply.github.com>
Co-authored-by: danielmarbach <174258+danielmarbach@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix outbox preventing transports from batching messages
Remove forced DispatchConsistency.Isolated for outbox operations
Feb 1, 2026
andreasohlund
approved these changes
Feb 2, 2026
Member
andreasohlund
left a comment
There was a problem hiding this comment.
How do we deal with users that was "relying" on this behavior like. https://discuss.particular.net/t/azure-service-bus-large-number-of-commands-outbox/4483
Do we need to make this opt-in for sometime?
Maybe we'd want to allow tuning of the message batch size when using outbox? When sending messages with outbox we can prioritize performance since we are not batching for reasons of transactional consistency, maybe? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Outbox was forcing
DispatchConsistency.Isolatedon all operations, preventing transports from batching messages. This was redundant - the outbox already enforcesTransportTransactionMode.ReceiveOnly, which by definition prevents enlistment in receive transactions.Changes
ForceBatchDispatchToBeIsolatedBehavior- Deleted behavior class and its pipeline registrationTransportReceiveToPhysicalMessageConnector- Changed outbox operation dispatch consistency fromIsolatedtoDefaultOutbox.cscomments - Clarified thatReceiveOnlymode already provides isolation guaranteesImpact
Transports supporting batching (Azure Service Bus, Amazon SQS) can now batch outbox operations, reducing latency and message operation costs.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
f.feedz.io/usr/bin/dotnet dotnet build src/NServiceBus.Core/NServiceBus.Core.csproj --no-restore(dns block)/usr/bin/dotnet dotnet build --no-restore -c Release(dns block)/usr/bin/dotnet dotnet restore src/NServiceBus.Core.Tests/NServiceBus.Core.Tests.csproj(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.