-
Notifications
You must be signed in to change notification settings - Fork 5
ASB transaction support #237
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
Conversation
src/NServiceBus.AzureFunctions.InProcess.ServiceBus/FunctionEndpoint.cs
Outdated
Show resolved
Hide resolved
src/NServiceBus.AzureFunctions.InProcess.ServiceBus/IFunctionEndpoint.cs
Outdated
Show resolved
Hide resolved
src/NServiceBus.AzureFunctions.InProcess.ServiceBus/FunctionEndpoint.cs
Outdated
Show resolved
Hide resolved
…ticular/NServiceBus.AzureFunctions.InProcess.ServiceBus into extract-transaction-strategy
Extract transaction strategy
* locate attribute to read AutoComplete value * rename public APIs * remove obsolete method usage * extract reflection code into helper * add more details to the reflection helper exception message * merge AttributeDiscoverer and ReflectionHelper methods
src/NServiceBus.AzureFunctions.SourceGenerator/TriggerFunctionGenerator2.cs
Outdated
Show resolved
Hide resolved
| // 3rd parameter might be trigger function name | ||
| triggerFunctionName = attributeParametersCount == 3 | ||
| ? AttributeParameterAtPosition(2) | ||
| : $"NServiceBusFunctionEndpointTrigger-{endpointName}"; |
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.
Should this be extracted as a helper method? It gets referenced above too.
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.
it doesn't look like we need to recompute the value here at all and can just use the initial value instead.
| : "await endpoint.ProcessNonTransactional(message, executionContext, messageReceiver, logger);")} | ||
| }} | ||
| }}"; | ||
| context.AddSource("NServiceBus__FunctionEndpointTrigger", SourceText.From(source, Encoding.UTF8)); |
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.
Is it OK to use the same hintname for both generators?
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.
🤷
| var property = typeof(Message).GetProperty("SystemProperties"); | ||
| property.SetValue(asbMessage, systemProperties); | ||
|
|
||
| asbMessage.MessageId = Guid.NewGuid().ToString("N"); |
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 don't think every message is guaranteed to have a MessageId. I noticed some code failures in one of the branches because we were missing this, and I think we have to be able to cope without it for native integrations.
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.
this is currently needed for some of the recoverability tests to ensure we can identify the message across retries as by default we generate new IDs each time a message without an ID is received ( see the implementation of GetMessageId)
src/NServiceBus.AzureFunctions.InProcess.ServiceBus/NServiceBusTriggerFunctionAttribute.cs
Outdated
Show resolved
Hide resolved
src/NServiceBus.AzureFunctions.InProcess.ServiceBus/NServiceBusTriggerFunctionAttribute.cs
Outdated
Show resolved
Hide resolved
src/NServiceBus.AzureFunctions.InProcess.ServiceBus/FunctionEndpoint.cs
Outdated
Show resolved
Hide resolved
…sTriggerFunctionAttribute.cs Co-authored-by: Mike Minutillo <mike.minutillo@particular.net>
# Conflicts: # src/NServiceBus.AzureFunctions.InProcess.ServiceBus/ServiceBusTriggeredEndpointConfiguration.cs
Resolves #43
Based on #68.
Adds support for transactional message processing