Azure Storage Queues Transport Upgrade Version 6 to 7

New Configuration API

In Versions 6 and below the Azure Storage Queues transport was configured using an XML configuration section called AzureStorageQueueTransportConfiguration. This section has been removed in favor of a more granular, code based configuration API.

The new configuration API is accessible through extension methods on the UseTransport<AzureStorageQueueTransport>() extension point in the endpoint configuration. See also Azure Storage Queues Configuration.

7.x NServiceBus.Azure.Transports.WindowsAzureStorageQueues
Edit
var transport = endpointConfiguration.UseTransport<AzureStorageQueueTransport>();
// Configure the transport
transport.ConnectionString("The Connection String");

Setting the configuration values via API

Setting the configuration values can now be done via API in the following way:

Can be set using corresponding extension methods like in an example:

7.x NServiceBus.Azure.Transports.WindowsAzureStorageQueues
Edit
var transport = endpointConfiguration.UseTransport<AzureStorageQueueTransport>();
transport.ConnectionString("DefaultEndpointsProtocol=https;AccountName=[ACCOUNT];AccountKey=[KEY];");
transport.BatchSize(20);
transport.MaximumWaitTimeWhenIdle(TimeSpan.FromSeconds(1));
transport.DegreeOfReceiveParallelism(16);
transport.PeekInterval(TimeSpan.FromMilliseconds(100));
transport.MessageInvisibleTime(TimeSpan.FromSeconds(30));

PurgeOnStartup

PurgeOnStartup setting now can be set on EndpointConfiguration using extension method.

7.x NServiceBus.Azure.Transports.WindowsAzureStorageQueues
Edit
endpointConfiguration.PurgeOnStartup(true);

DefaultQueuePerInstance

DefaultQueuePerInstance setting was deprecated and currently for setting this behavior refer to the Data distribution article.

Default value changes

The default values of the following settings have been changed:

  • ConnectionString which had a default value of UseDevelopmentStorage=true, was removed and became obligatory.
  • BatchSize changed from 10 to 32.

Serialization

In previous versions, the Azure Storage Queues Transport change the default SerializationDefinition to JsonSerializer.

In Version 6 of NServiceBus transports no longer have the ability to manipulate serialization. To preserve backward compatibility and ensure that message payloads are small, setting JSON serialization should now be done on the endpoint configuration level.

7.x NServiceBus.Azure.Transports.WindowsAzureStorageQueues
Edit
endpointConfiguration.UseSerialization<JsonSerializer>();
endpointConfiguration.UseTransport<AzureStorageQueueTransport>();

API Changes

In Version 7 the public API has been reduced. As a result, multiple classes that used to be public in Versions 6 and below were marked as obsolete with a comment:

This class served only internal purposes without providing any extensibility point and as such was removed from the public API. For more information, refer to the documentation.

If code exist that depends on classes that were obsoleted with the above message, and it is not clear how to update it, then contact support to get help in resolving that issue.

Related Articles


Last modified