Azure Service Bus Transport Upgrade Version 1 to 2

Configuring Azure Service Bus Transport

To use Azure Service Bus Transport for NServiceBus, create a new instance 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 do no longer need to be passed to the CustomizeNativeMessage method. See the native message customization documentation for further detail.

Related Articles


Last modified