Update to Microsoft.Azure.WebJobs.Extensions.ServiceBus SDK version 5
The dependency on Microsoft.Azure.WebJobs.Extensions.ServiceBus has been updated which means that the new Azure.Messaging.ServiceBus SDK is being used by the function host to receive messages. If the solution contains code that directly accesses native SDK types, read the Microsoft Migration Guide.
Microsoft.Azure.WebJobs.Extensions.ServiceBus Version 5 requires EnableCrossEntityTransactions
to be enabled in order to support sends atomic with receive.
This can be done by adding the following to host.
:
"extensions": {
"ServiceBus": {
"EnableCrossEntityTransactions": true
}
}
Manually invoking process message
In version 2 of the Azure Functions package, IFunctionEndpoint
exposes two different Process
methods where the one accepting a IMessageReceiver
is the one that processed the message in "atomic sends with receive" mode.
Version 3 exposes different methods for the two different use cases.
Use:
Task ProcessAtomic(ServiceBusReceivedMessage message, ExecutionContext executionContext, ServiceBusClient serviceBusClient, ServiceBusMessageActions messageActions, ILogger functionsLogger = null);
to process the message with "atomic sends with receive" transaction mode.
Use:
Task ProcessNonAtomic(ServiceBusReceivedMessage message, ExecutionContext executionContext, ILogger functionsLogger = null);
to process the message in "receive only" transaction mode.
Injecting FunctionEndpoint
FunctionEndpoint
can no longer be injected, use IFunctionEndpoint
instead.