Azure Service Bus Transport Upgrade Version 1 to 2

Configuring the Azure Service Bus transport

To use the Azure Service Bus transport for NServiceBus, create a new instance of AzureServiceBusTransport and pass it to EndpointConfiguration.UseTransport.

Instead of

var transport = endpointConfiguration.UseTransport<AzureServiceBusTransport>();
transport.ConnectionString(connectionString);

Use:

var transport = new AzureServiceBusTransport(connectionString);
endpointConfiguration.UseTransport(transport);

Configuration options

The Azure Service Bus Transport configuration options have been moved to the AzureServiceBusTransport class. See the following table for further information:

Version 1 configuration optionVersion 2 configuration option
TopicNameTopicName
EntityMaximumSizeEntityMaximumSize
EnablePartitioningEnablePartitioning
PrefetchMultiplierPrefetchMultiplier
PrefetchCountPrefetchCount
TimeToWaitBeforeTriggeringCircuitBreakerTimeToWaitBeforeTriggeringCircuitBreaker
SubscriptionNameShortenerSubscriptionNamingConvention
SubscriptionNamingConventionSubscriptionNamingConvention
RuleNameShortenerSubscriptionRuleNamingConvention
SubscriptionRuleNamingConventionSubscriptionRuleNamingConvention
UseWebSocketsUseWebSockets
CustomTokenProviderTokenProvider
CustomRetryPolicyRetryPolicy

Native message customization

IMessageHandlerContext and IPipelineContext no longer need to be passed to the CustomizeNativeMessage method. See the native message customization documentation for further details.

Related Articles


Last modified