Skip to content

Conversation

@timbussmann
Copy link
Contributor

@timbussmann timbussmann commented Jul 27, 2021

Resolves #43
Based on #68.

Adds support for transactional message processing

@timbussmann timbussmann requested a review from SeanFeldman July 27, 2021 15:51
mikeminutillo and others added 4 commits August 6, 2021 10:21
* 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
// 3rd parameter might be trigger function name
triggerFunctionName = attributeParametersCount == 3
? AttributeParameterAtPosition(2)
: $"NServiceBusFunctionEndpointTrigger-{endpointName}";
Copy link
Member

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.

Copy link
Contributor Author

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));
Copy link
Member

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?

Copy link
Contributor Author

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");
Copy link
Member

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.

Copy link
Contributor Author

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)

@timbussmann timbussmann marked this pull request as ready for review August 9, 2021 07:48
# Conflicts:
#	src/NServiceBus.AzureFunctions.InProcess.ServiceBus/ServiceBusTriggeredEndpointConfiguration.cs
@HEskandari HEskandari self-requested a review August 9, 2021 08:24
@timbussmann timbussmann merged commit b7ec47f into master Aug 9, 2021
@timbussmann timbussmann deleted the transactions branch August 9, 2021 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for SendsAtomicWithReceive

5 participants