This version relies on NServiceBus.
version 2 which uses the new Azure.
SDK from Microsoft. See the transport upgrade guide for more details.
Registering NServiceBus
All public constructors of ServiceBusTriggeredEndpointConfiguration
have been made internal.
Instead of
functionsHostBuilder.UseNServiceBus(() => new ServiceBusTriggeredEndpointConfiguration(endpointName));
use:
functionsHostBuilder.UseNServiceBus(endpointName);
The endpoint name can be inferred from NServiceBusTriggerFunctionAttribute
if present.
[assembly: NServiceBusTriggerFunction("MyEndpoint")]
// ...
functionsHostBuilder.UseNServiceBus(); // Will use the name MyEndpoint
The constructed instance of NServiceBusTriggeredEndpointConfiguration
already contains a reference to an IConfiguration
instance from the host environment. It is not required to pass one in.
Routing
Instead of
functionsHostBuilder.UseNServiceBus(() =>
{
var serviceBusTriggeredEndpointConfiguration = new ServiceBusTriggeredEndpointConfiguration(endpointName);
var routing = serviceBusTriggeredEndpointConfiguration.Transport.Routing();
routing.RouteToEndpoint(typeof(SomeMessage), "AnotherEndpoint");
return serviceBusTriggeredEndpointConfiguration;
});
use:
functionsHostBuilder.UseNServiceBus(endpointName, endpointConfiguration =>
{
endpointConfiguration.Routing.RouteToEndpoint(typeof(SomeMessage), "AnotherEndpoint");
});
Static hosting model has been deprecated
The ServiceBusTriggeredEndpointConfiguration.
static factory method that was used in the preview package has been deprecated. Instead, use the host builder configuration model.