Skip to content
On this page

Azure Storage Queues

PM> Install-Package Shuttle.Esb.AzureStorageQueues

In order to make use of the AzureStorageQueue you will need access to an Azure Storage account or use the Azurite emulator for local Azure Storage development.

You may want to take a look at how to get started with Azure Queue storage using .NET.

Configuration

The URI structure is azuresq://configuration-name/queue-name.

c#
services.AddAzureStorageQueues(builder =>
{
    var azureStorageQueueOptions = new AzureStorageQueueOptions
    {
        ConnectionString = "UseDevelopmentStorage=true",
        MaxMessages = 20,
        VisibilityTimeout = null
    };

    azureStorageQueueOptions.Configure += (sender, args) =>
    {
        Console.WriteLine($"[event] : Configure / Uri = '{((IQueue)sender).Uri}'");
    };

    builder.AddOptions("azure", azureStorageQueueOptions);
});

The Configure event args arugment exposes the QueueClientOptions directly for any specific options that need to be set.

The default JSON settings structure is as follows:

json
{
  "Shuttle": {
    "AzureStorageQueues": {
      "azure": {
        "ConnectionString": "UseDevelopmentStorage=true",
        "MaxMessages": 32,
        "VisibilityTimeout": "00:00:30"
      }
    }
  }
}

Options

Segment / ArgumentDefaultDescription
ConnectionStringThe Azure Storage Queue endpoint to connect to.
MaxMessages32Specifies the number of messages to fetch from the queue.
VisibilityTimeoutnull
Azure Storage Queues has loaded