Getting Started
Architecture
NServiceBus
Persistence
ServiceInsight
ServicePulse
ServiceControl
Monitoring
Samples

Azure Storage Queues Transport

Azure Storage Queues is a service hosted on the Azure platform, used for storing large numbers of messages. The messages can be accessed from anywhere in the world via authenticated calls using HTTP or HTTPS.

Azure Storage Queues are designed for very large cloud networks or hybrid networks, providing a highly reliable and inexpensive queuing service. A single message can be up to 64 KB in size and a queue can hold millions of messages, up to the total capacity limit of the storage account (200 TB). Furthermore, it is capable to emulate local transactions using its queue Peek-Lock mechanism.

The main disadvantages of this service is latency introduced by remoteness and the fact that it supports only HTTP-based communication.

As part of the Azure support for NServiceBus, one can choose between two transports provided by the Azure platform: Azure Storage Queues and Azure Service Bus. Each of them has different features, capabilities, and usage characteristics. A detailed comparison and discussion of when to select which is beyond the scope of this document. To help decide which option best suits the application's needs, refer to the Azure Queues and Azure Service Bus Queues - Compared and Contrasted article.

When considering an Azure Transport it is important to consider the transaction guarantees that that service provides.

Transport at a glance

Feature
TransactionsNone, ReceiveOnly (Message visibility timeout)
Pub/SubNative (Requires Storage Table)
TimeoutsNative (Requires Storage Table)
Large message bodiesData bus
Scale-outCompeting consumer
Scripted DeploymentNot supported
InstallersMandatory
Native integrationSupported

Configuring the endpoint

To use Azure Storage Queues as the underlying transport configure it as follows:

var transport = new AzureStorageQueueTransport("DefaultEndpointsProtocol=https;AccountName=[ACCOUNT];AccountKey=[KEY];");

endpointConfiguration.UseTransport(transport);

Then set up appropriate connection strings.

The existing API surface with UseTransport<T>() is supported for NServiceBus version 8 via a shim API to ease migration to the new version. However, it is recommended to switch to the new transport configuration API to prepare for future upgrades of NServiceBus.
When using Azure Storage Queues transport, a serializer must be configured explicitly by the UseSerialization API.

Samples

Related Articles


Last modified