-
Notifications
You must be signed in to change notification settings - Fork 120
Add the possibility to modify properties when abandoning a message #671
base: dev
Are you sure you want to change the base?
Conversation
This is useful to store exception details when abandoning a message and still keeping the convenience of registering a message or session handler with AutoComplete = true
3ccd7b1
to
4e6ca73
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this approach better. It's not as invasive as #646 and does not complicate APIs.
@@ -6,6 +6,7 @@ | |||
<SignAssembly>true</SignAssembly> | |||
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign> | |||
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles> | |||
<LangVersion>7.3</LangVersion> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make it latest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I set it explicitly to 7.3 because C# 7.3 is needed for the tests to compile after I added the second MessageHandlerOptions
constructor. See Unable to invoke overload when argument is func of non generic task and supplied as method which describes the exact same situation where the compiler generates errors if LangVersion is smaller than 7.3:
OnSessionQueueTests.cs(63, 47): [CS0407] 'Task OnSessionQueueTests.ExceptionReceivedHandler(ExceptionReceivedEventArgs)' has the wrong return type
OnSessionQueueTests.cs(147, 47): [CS0407] 'Task OnSessionQueueTests.ExceptionReceivedHandler(ExceptionReceivedEventArgs)' has the wrong return type
OnSessionTopicSubscriptionTests.cs(104, 47): [CS0407] 'Task OnSessionTopicSubscriptionTests.ExceptionReceivedHandler(ExceptionReceivedEventArgs)' has the wrong return type
SenderReceiverClientTestBase.cs(262, 43): [CS0407] 'Task SenderReceiverClientTestBase.ExceptionReceivedHandler(ExceptionReceivedEventArgs)' has the wrong return type
SenderReceiverClientTestBase.cs(292, 43): [CS0407] 'Task SenderReceiverClientTestBase.ExceptionReceivedHandler(ExceptionReceivedEventArgs)' has the wrong return type
But I’m happy to bump it to latest
if you think it’s better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test project is free to use the latest and greatest. Rather than bumping it manually all the time, it could be on the latest all the time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@0xced - Lets discuss this before we take this further. I don't want a lot of hard work to go wasted. What is the intention, what is that we are trying to solve, and is it going to complicate things? Are we giving promises that everytime we run into exception, we would be updating the properties? There might be lot of exceptions that are raised for which we will not be able to update them. For example, CommunicationException, or say LockLostException etc. What if autocomplete fails and that is the reason we raise an exception? There are lot of places where we call the exception handler. What is the expectation from the handler code in those cases? How will it distinguish between exception thrown from the message handler, vs exception thrown from doing auto complete?
Only when the exception happens in the user callback, i.e. the
I’m not sure about azure-service-bus-dotnet/src/Microsoft.Azure.ServiceBus/MessageReceivePump.cs Lines 153 to 157 in 4e6ca73
By the way, I wonder how a
I have documented this: the returned dictionary is ignored. Maybe this documentation needs improvement? azure-service-bus-dotnet/src/Microsoft.Azure.ServiceBus/MessageHandlerOptions.cs Lines 43 to 44 in 4e6ca73
I’m not sure I fully understand your concern. I think it doesn’t matter since the returned dictionary is ignored when azure-service-bus-dotnet/src/Microsoft.Azure.ServiceBus/MessageReceivePump.cs Lines 210 to 224 in 4e6ca73
If you meant from the user of the library point of view, the |
@nemakam Any thoughts on this? |
This is useful to store exception details when abandoning a message and still keeping the convenience of registering a message or session handler with
AutoComplete = true
.Replaces #646