PollyAzureQueueStorage 1.0.2
dotnet add package PollyAzureQueueStorage --version 1.0.2
NuGet\Install-Package PollyAzureQueueStorage -Version 1.0.2
<PackageReference Include="PollyAzureQueueStorage" Version="1.0.2" />
<PackageVersion Include="PollyAzureQueueStorage" Version="1.0.2" />
<PackageReference Include="PollyAzureQueueStorage" />
paket add PollyAzureQueueStorage --version 1.0.2
#r "nuget: PollyAzureQueueStorage, 1.0.2"
#:package PollyAzureQueueStorage@1.0.2
#addin nuget:?package=PollyAzureQueueStorage&version=1.0.2
#tool nuget:?package=PollyAzureQueueStorage&version=1.0.2
PollyAzureQueueStorage
Polly v8 resilience pipelines for Azure Queue Storage — retry, timeout, and circuit-breaker for QueueClient operations.
Why PollyAzureQueueStorage?
Azure Queue Storage is a durable, scalable message queue — but transient failures (throttling 429, service unavailability 503, gateway timeouts 504) can disrupt your messaging pipeline. PollyAzureQueueStorage wraps QueueClient in a Polly v8 ResiliencePipeline so send, receive, peek, and delete all automatically retry on transient errors.
Completes the Azure storage trio alongside PollyAzureBlob and PollyAzureTableStorage.
Installation
dotnet add package PollyAzureQueueStorage
Quick start
DI registration
`csharp services.AddPollyAzureQueueStorage( connectionString: Environment.GetEnvironmentVariable("AZURE_STORAGE_CONN"), queueName: "my-queue", configure: pipeline ⇒ pipeline .AddRetry(new RetryStrategyOptions { MaxRetryAttempts = 3, Delay = TimeSpan.FromSeconds(1), BackoffType = DelayBackoffType.Exponential, ShouldHandle = QueueStorageTransientErrors.IsTransient, }) .AddTimeout(TimeSpan.FromSeconds(30)));
// Use via DI public class QueueService(ResilientQueueClient queue) { public async Task SendAsync(string message, CancellationToken ct = default) ⇒ await queue.SendMessageAsync(message, ct); } `
WithPolly() extension on existing QueueClient
`csharp var queueClient = new QueueClient(connectionString, "my-queue");
var resilient = queueClient.WithPolly(pipeline ⇒ pipeline.AddRetry(new RetryStrategyOptions { MaxRetryAttempts = 3, Delay = TimeSpan.FromSeconds(1), BackoffType = DelayBackoffType.Exponential, ShouldHandle = QueueStorageTransientErrors.IsTransient, }));
await resilient.SendMessageAsync("hello"); var messages = await resilient.ReceiveMessagesAsync(maxMessages: 10); `
API surface
| Method | Description |
|---|---|
| SendMessageAsync(string, CancellationToken) | Enqueue a plain-text message |
| SendMessageAsync(BinaryData, CancellationToken) | Enqueue binary/JSON message |
| ReceiveMessagesAsync(int, TimeSpan?, CancellationToken) | Dequeue up to N messages |
| PeekMessagesAsync(int, CancellationToken) | Peek without dequeuing |
| DeleteMessageAsync(string, string, CancellationToken) | Delete after processing |
| ExecuteAsync<T>(Func<CancellationToken, ValueTask<T>>, CancellationToken) | Custom operation |
Transient error predicate
QueueStorageTransientErrors.IsTransient handles:
| Exception | Condition |
|---|---|
| RequestFailedException | Status 429 (throttled), 503 (unavailable), 504 (gateway timeout) |
| HttpRequestException | Network-level failure |
| TaskCanceledException | Timeout or cancellation |
Supported frameworks
et6.0 · et8.0 · et9.0
Related Packages
| Package | Downloads | Description |
|---|---|---|
| PollyHealthChecks | ASP.NET Core health checks for Polly v8 circuit breakers — expose circuit-breaker state (Closed, HalfOpen, Open, Isolated) as /health endpoint responses | |
| PollyBackoff | Backoff delay strategies for Polly v8 resilience pipelines | |
| PollyGrpc | Polly v8 resilience interceptor for gRPC | |
| PollyEFCore | Polly v8 resilience pipelines for Entity Framework Core — wrap every EF Core query and SaveChanges with retry, timeout and circuit-breaker via a single AddPollyResilience() call | |
| PollyRabbitMQ | Polly v8 resilience for RabbitMQ.Client v7+ — retry, circuit-breaker, and timeout for IChannel operations, with built-in RabbitMqTransientErrors predicate covering AlreadyClosedException, BrokerUnreachableException, OperationInterruptedException, and ConnectFailureException | |
| PollyMailKit | Polly v8 resilience pipelines for MailKit — retry, timeout, and circuit-breaker for SmtpClient.SendAsync and any MailKit SMTP operation | |
| PollyMassTransit | Polly v8 resilience pipelines for MassTransit — retry, timeout, and circuit-breaker for IBus.Publish and ISendEndpointProvider.Send | |
| PollyNpgsql | Polly v8 resilience pipelines for Npgsql (PostgreSQL) — retry, timeout, and circuit-breaker for NpgsqlConnection queries and commands, plus a built-in PostgresTransientErrors predicate covering all common PostgreSQL transient SQLSTATE codes | |
| PollyOpenAI | Polly v8 resilience for OpenAI and Azure OpenAI API calls | |
| PollyAzureEventHub | Polly v8 resilience pipelines for Azure Event Hubs — retry, timeout, and circuit-breaker for EventHubProducerClient and EventHubConsumerClient | |
| PollySignalR | Polly v8 reconnect policy for SignalR | |
| PollyElasticsearch | Polly v8 resilience pipelines for Elastic.Clients.Elasticsearch 8+ — retry, timeout, and circuit-breaker for any Elasticsearch operation, plus a built-in ElasticTransientErrors predicate covering rate limiting (429), service unavailability (503), gateway timeouts (504), and connection failures | |
| PollyHangfire | Polly v8 resilience pipelines for Hangfire — retry, timeout, and circuit-breaker for IBackgroundJobClient.Enqueue and Schedule | |
| PollyCosmosDb | Polly v8 resilience pipelines for Azure Cosmos DB — retry, timeout, and circuit-breaker for Container operations, plus a built-in CosmosTransientErrors predicate covering rate limiting (429), timeouts (408), partition failovers (410), and service unavailability (503) | |
| PollySendGrid | Polly v8 resilience pipelines for SendGrid — retry, timeout, and circuit-breaker for ISendGridClient.SendEmailAsync | |
| PollyMongo | Polly v8 resilience pipelines for MongoDB.Driver — wrap Find, InsertOne, UpdateOne, DeleteOne and other IMongoCollection calls with retry, timeout, circuit-breaker, and more using a single ResilientMongoCollection decorator | |
| PollyDapper | Polly v8 resilience pipelines for Dapper — wrap QueryAsync, ExecuteAsync, and other Dapper calls with retry, timeout, circuit-breaker, and more using a single ResilientDbConnection decorator | |
| PollyMediatR | Polly v8 resilience pipelines for MediatR — add retry, timeout, circuit-breaker, rate-limiting, hedging, and chaos engineering to any MediatR request handler with a single line of DI registration | |
| PollySqlClient | Polly v8 resilience pipelines for Microsoft.Data.SqlClient (SQL Server and Azure SQL) — retry, timeout, and circuit-breaker for SqlConnection queries and commands, plus a built-in SqlServerTransientErrors predicate covering all common SQL Server and Azure SQL transient error numbers | |
| PollyAzureKeyVault | Polly v8 resilience pipelines for Azure Key Vault — retry, timeout, and circuit-breaker for SecretClient, KeyClient, and CertificateClient | |
| PollyRedis | Polly v8 resilience for StackExchange.Redis | |
| PollyAzureServiceBus | Polly v8 resilience for Azure Service Bus — retry, circuit breaker, and timeout for sending and receiving messages | |
| PollyAzureBlob | Polly v8 resilience pipelines for Azure Blob Storage — wrap BlobClient and BlobContainerClient operations with retry, timeout, circuit-breaker, and more using ResilientBlobClient and ResilientBlobContainerClient decorators | |
| PollyKafka | Polly v8 resilience for Confluent.Kafka — retry, circuit breaker, and timeout for producers and consumers | |
| PollyAzureTableStorage | Polly v8 resilience pipelines for Azure Table Storage — retry, timeout, and circuit-breaker for Azure.Data.Tables TableClient | |
| PollyRateLimiter | Convenience extension methods for Polly v8 resilience pipelines: AddFixedWindowRateLimiter, AddSlidingWindowRateLimiter, and AddTokenBucketRateLimiter | |
| PollyChaos | Chaos engineering and fault-injection resilience strategies for Polly v8 pipelines |
💼 Need .NET consulting?
The author of this package is available for consulting on Polly v8 resilience, Azure cloud architecture, and clean .NET design.
→ solidqualitysolutions.com · LinkedIn
License
MIT © Justin Bannister
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Azure.Storage.Queues (>= 12.27.1)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.10)
- Polly.Core (>= 8.7.0)
-
net6.0
- Azure.Storage.Queues (>= 12.27.1)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.10)
- Polly.Core (>= 8.7.0)
-
net8.0
- Azure.Storage.Queues (>= 12.27.1)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.10)
- Polly.Core (>= 8.7.0)
-
net9.0
- Azure.Storage.Queues (>= 12.27.1)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.10)
- Polly.Core (>= 8.7.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
1.0.1: Fix package icon (was showing an incorrect/placeholder image). 1.0.0: Initial release. ResilientQueueClient wraps Azure.Storage.Queues QueueClient in a Polly v8 ResiliencePipeline. Includes QueueStorageTransientErrors predicate covering RequestFailedException (429, 503, 504), HttpRequestException, and TaskCanceledException. Supports net6.0, net8.0, and net9.0.