https://github.com/shuttle/shuttle.esb.azurestoragequeues
Azure Storage Queue implementation for use with Shuttle.Esb.
https://github.com/shuttle/shuttle.esb.azurestoragequeues
Last synced: 12 months ago
JSON representation
Azure Storage Queue implementation for use with Shuttle.Esb.
- Host: GitHub
- URL: https://github.com/shuttle/shuttle.esb.azurestoragequeues
- Owner: Shuttle
- License: bsd-3-clause
- Created: 2020-10-13T17:21:06.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-03-02T06:22:01.000Z (about 1 year ago)
- Last Synced: 2025-03-02T07:23:18.712Z (about 1 year ago)
- Language: C#
- Size: 108 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](https://docs.microsoft.com/en-us/azure/storage/common/storage-use-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](https://docs.microsoft.com/en-us/azure/storage/queues/storage-dotnet-how-to-use-queues?tabs=dotnet).
## Configuration
The URI structure is `azuresq://configuration-name/queue-name`.
If `ConnectionString` is specified the `StorageAccount` setting will be ignored. Well `StorageAccount` is specified the `DefaultAzureCredential` will be used to authenticate.
```c#
services.AddAzureStorageQueues(builder =>
{
var azureStorageQueueOptions = new AzureStorageQueueOptions
{
StorageAccount = "devstoreaccount1",
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": {
"StorageAccount": "devstoreaccount1",
"ConnectionString": "UseDevelopmentStorage=true",
"MaxMessages": 32,
"VisibilityTimeout": "00:00:30"
}
}
}
}
```
## Options
| Segment / Argument | Default | Description |
| --- | --- | --- |
| `StorageAccount` | | The name of the storage. |
| `ConnectionString` | | The Azure Storage Queue endpoint to connect to. |
| `MaxMessages` | `32` | Specifies the number of messages to fetch from the queue. |
| `VisibilityTimeout` | `null` | | The message visibility timeout that will be used for messages that fail processing. |