Use explicit message settlement via ServiceBusMessageActions#43
Open
andreasohlund wants to merge 57 commits intomainfrom
Open
Use explicit message settlement via ServiceBusMessageActions#43andreasohlund wants to merge 57 commits intomainfrom
andreasohlund wants to merge 57 commits intomainfrom
Conversation
Member
Author
|
@danielmarbach ready for a initial review, some todos left in code for us to discuss |
src/NServiceBus.AzureFunctions.AzureServiceBus/PipelineInvokingMessageProcessor.cs
Outdated
Show resolved
Hide resolved
src/NServiceBus.AzureFunctions.AzureServiceBus/PipelineInvokingMessageProcessor.cs
Outdated
Show resolved
Hide resolved
src/NServiceBus.AzureFunctions.AzureServiceBus/PipelineInvokingMessageProcessor.cs
Outdated
Show resolved
Hide resolved
src/NServiceBus.AzureFunctions.AzureServiceBus/PipelineInvokingMessageProcessor.cs
Outdated
Show resolved
Hide resolved
Member
Author
|
@danielmarbach ready for final review |
danielmarbach
requested changes
Mar 24, 2026
src/NServiceBus.AzureFunctions.AzureServiceBus/PipelineInvokingMessageProcessor.cs
Show resolved
Hide resolved
src/NServiceBus.AzureFunctions.AzureServiceBus/PipelineInvokingMessageProcessor.cs
Outdated
Show resolved
Hide resolved
src/NServiceBus.AzureFunctions.AzureServiceBus/PipelineInvokingMessageProcessor.cs
Outdated
Show resolved
Hide resolved
src/NServiceBus.AzureFunctions.AzureServiceBus/DeadLetterMessage.cs
Outdated
Show resolved
Hide resolved
…validate stack trace
…them immediately on retry
Member
Author
|
@DavidBoike adding you FYI so no need to go deep into this one, the description should give you a good overview |
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.
This uses message actions to explicitly control message settlement, including the ability to DLQ messages and perform other advanced operations that are only available via the actions.
Design decisions
Auto generation of MessageID
If no message ID is present on the native service bus message or in the application properties, a new ID will be generated and used. This new ID is persisted, so that the same ID is used when the message is retried, ensuring that the message is not abandoned or deadlettered. This further lowers the bar for native integration.
Messages that fail to be completed will not be reprocessed
Similar to the ASB transport messages that succeed processing but fail when the message is being completed, they will be completed immediately on the next processing attempt to reduce duplicate processing.
NOTE: The message id's are stored in an in-memory LRU cache, so duplicate processing on scaled-out instances can still occur, so this does not replace the use of the Outbox
Align upconversion of message properties to headers with the ASB transport
The same message properties (ReplyTo, CorrelationId, and ContentType) as the transport are now upconverted to NServiceBus headers.
DLQ poison messages
Messages where extracting the body and the headers are now dead-lettered in the same way as the transport.
DLQ messages when OnError fails with a non-transient exception
Failures in onError that are not transient service bus exceptions will now result in the message being dead-lettered
Support explicit DLQ requests via recoverability action
The existing package had a
.DoNotSendMessagesToErrorQueueoption, which resulted in retrying until the max delivery count was reached. This option is replaced with support for explicitly requesting the message being processed to be dead-lettered via a new recoverability action:Remove support for the ASB transport legacy body format
With this being a new component, supporting the very old ASB transport format is no longer needed. Customers can use a behavior in the physical receive pipeline to transform the body to be compatible as needed: