Use explicit message settlement via ServiceBusMessageActions#43
Use explicit message settlement via ServiceBusMessageActions#43andreasohlund wants to merge 49 commits intomainfrom
Conversation
|
@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
|
@danielmarbach addressed your comment, there are a few things that needs to be discussed, left those as TODO's in the code |
|
@danielmarbach ready for final review |
src/NServiceBus.AzureFunctions.AzureServiceBus/PipelineInvokingMessageProcessor.cs
Show resolved
Hide resolved
src/NServiceBus.AzureFunctions.AzureServiceBus/PipelineInvokingMessageProcessor.cs
Show resolved
Hide resolved
| { | ||
| logger.LogError(exception, "Message dead lettered due to exception"); | ||
|
|
||
| return messageActions.DeadLetterMessageAsync(message, |
There was a problem hiding this comment.
In the transport, we wrap things we more try catch inside and log statements. Worth doing something similar? Doesn't have to be an extension method thught
|
|
||
| public class DeadLetterMessage(string deadLetterReason, string deadLetterErrorDescription, Dictionary<string, object>? propertiesToModify = null) : RecoverabilityAction | ||
| { | ||
| public DeadLetterMessage(Exception exception) : this($"{exception.GetType().FullName!} - {exception.Message}", exception.StackTrace ?? exception.ToString(), null) |
There was a problem hiding this comment.
As far as I understand there are restrictions on how much data we can pass. So I wonder if we should do the following:
DeadLetterReason = ex.GetType().FullName
DeadLetterErrorDescription = first 1024-2048 chars of ex.Message
and then set the regular NServiceBus Exception headers like core would do because then things are already in the right shape and if that fails just the reason and the description and if that fails nothing else. Then in the best case you always get some extra useful information but in the case we have a message that is close to the message size restrictions we can still dead-letter things properly
There was a problem hiding this comment.
Also should we allow modifying the source or should we keep that auto assigned by the service?
…validate stack trace
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.
This PR also: