Azure Storage Queues Transport Upgrade Version 9 to 10

Configuring the transport

Upgrading from NServiceBus.Azure.Transports.WindowsAzureStorageQueues version 9 to 10 requires code changes to use the new transport API.

The transport configuration API has been changed. Instead of the generic based UseTransport<AzureStorageQueueTransport> method, create an instance of the transport's configuration class and pass it to UseTransport, e.g.

var transport = endpointConfiguration.UseTransport<AzureStorageQueueTransport>();
transport.Transactions(TransportTransactionMode.ReceiveOnly);
var routing = t.Routing();
routing.RouteToEndpoint(typeof(MyMessage), "DestinationEndpoint");

becomes:

var transport = new AzureStorageQueueTransport("azure-storage-connection-string")
{
    TransportTransactionMode = TransportTransactionMode.ReceiveOnly
};
var routing = endpointConfiguration.UseTransport(transport);
routing.RouteToEndpoint(typeof(MyMessage), "DestinationEndpoint");

Configuration Options

The Azure Queue Storage transport configuration options have been moved to the AzureStorageQueueTransport class properties and constructor(s). See the following table for further information:

Version 9 configuration optionVersion 10 configuration option
MessageInvisibleTimeMessageInvisibleTime
PeekIntervalPeekInterval
MaximumWaitTimeWhenIdleMaximumWaitTimeWhenIdle
SanitizeQueueNamesWithQueueNameSanitizer
BatchSizeReceiverBatchSize
DegreeOfReceiveParallelismDegreeOfReceiveParallelism
SerializeMessageWrapperWithMessageWrapperSerializationDefinition
UnwrapMessagesWithMessageUnwrapper
UseQueueServiceClientuse the transport constructor overload
UseBlobServiceClientuse the transport constructor overload
UseCloudTableClientuse the transport constructor overload
DelayedDeliveryDelayedDelivery
AccountRoutingAccountRouting
DefaultAccountAliasAccountRouting.DefaultAccountAlias
UseTableNameDelayedDelivery.DelayedDeliveryTableName
DisableDelayedDeliveryuse the transport constructor overload

Related Articles


Last modified