Soenneker.Redis.WorkQueue
4.0.76
Prefix Reserved
See the version list below for details.
dotnet add package Soenneker.Redis.WorkQueue --version 4.0.76
NuGet\Install-Package Soenneker.Redis.WorkQueue -Version 4.0.76
<PackageReference Include="Soenneker.Redis.WorkQueue" Version="4.0.76" />
<PackageVersion Include="Soenneker.Redis.WorkQueue" Version="4.0.76" />
<PackageReference Include="Soenneker.Redis.WorkQueue" />
paket add Soenneker.Redis.WorkQueue --version 4.0.76
#r "nuget: Soenneker.Redis.WorkQueue, 4.0.76"
#:package Soenneker.Redis.WorkQueue@4.0.76
#addin nuget:?package=Soenneker.Redis.WorkQueue&version=4.0.76
#tool nuget:?package=Soenneker.Redis.WorkQueue&version=4.0.76
Soenneker.Redis.WorkQueue
A durable, partition-aware Redis work queue with scheduling, leases, retries, deduplication, and round-robin fairness.
Installation
dotnet add package Soenneker.Redis.WorkQueue
Registration
services.AddRedisWorkQueueAsSingleton<SendMessageWork>("send-message", options =>
{
options.MaxConcurrentItemsPerPartition = 2;
options.ClaimLeaseDuration = TimeSpan.FromMinutes(1);
options.MaximumAttempts = 10;
options.MaintenanceInterval = TimeSpan.FromSeconds(1);
});
Registration starts a background maintenance service by default. Every process may register it; a distributed Redis semaphore ensures that only one process maintains a logical queue at a time. Set EnableBackgroundMaintenance to false only when another component calls RunMaintenance periodically.
AddRedisWorkQueueAsScoped<T>() scopes the queue and semaphore wrappers while retaining the shared Redis client transport. Disposing a scope does not close the application's Redis connection.
The partition key is the fairness and concurrency boundary. In Leadping, for example, use the business ID. Ready partitions are dispatched round-robin, and Soenneker.Redis.Semaphores prevents more than the configured number of claims for one partition across every process.
Enqueue and process
await queue.Enqueue(new RedisWorkQueueItem<SendMessageWork>
{
Id = message.Id,
PartitionKey = message.BusinessId,
Value = new SendMessageWork(message.Id),
AvailableAt = DateTimeOffset.UtcNow // set a future value to schedule it
}, cancellationToken);
await using RedisWorkQueueClaim<SendMessageWork>? claim =
await queue.TryClaim(workerId, cancellationToken);
if (claim is null)
return;
try
{
await Process(claim.Item.Value, claim.OwnershipLostToken);
await queue.Complete(claim, cancellationToken);
}
catch (Exception exception)
{
await queue.Retry(claim, new RedisWorkQueueFailure
{
Reason = exception.GetType().Name,
Details = exception.Message
}, TimeSpan.FromSeconds(10), cancellationToken);
throw;
}
The queue provides at-least-once delivery. Claims automatically renew both their work-item lease and their partition semaphore permit. Background maintenance promotes scheduled items, recovers expired claims, repairs ready partitions, and expires completed-item deduplication markers.
Retry moves work to the dead-letter store when it reaches MaximumAttempts. Use GetDeadLetter and RequeueDeadLetter to inspect and recover valid items. Missing or unreadable payloads are dead-lettered automatically so they cannot block a partition. Use Abandon when a healthy worker needs to relinquish a claim immediately without treating it as a processing failure.
The implementation uses typed Soenneker.Redis.Util operations and Redis transactions with optimistic conditions. It does not use Redis scripts.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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
- Soenneker.Hashing.Sha256 (>= 4.0.4)
- Soenneker.Redis.Semaphores (>= 4.0.63)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.88 | 61 | 9/19/2026 |
| 4.0.87 | 55 | 9/17/2026 |
| 4.0.86 | 44 | 9/17/2026 |
| 4.0.85 | 53 | 9/17/2026 |
| 4.0.84 | 54 | 9/16/2026 |
| 4.0.83 | 50 | 9/16/2026 |
| 4.0.82 | 48 | 9/16/2026 |
| 4.0.81 | 56 | 9/15/2026 |
| 4.0.80 | 97 | 9/14/2026 |
| 4.0.79 | 96 | 9/13/2026 |
| 4.0.78 | 89 | 9/13/2026 |
| 4.0.77 | 89 | 9/13/2026 |
| 4.0.76 | 84 | 9/13/2026 |
| 4.0.75 | 88 | 9/13/2026 |
| 4.0.74 | 90 | 9/12/2026 |
| 4.0.73 | 83 | 9/12/2026 |
| 4.0.71 | 106 | 9/10/2026 |
| 4.0.70 | 98 | 9/9/2026 |
| 4.0.69 | 94 | 9/9/2026 |
| 4.0.68 | 103 | 9/8/2026 |