NexJob.Redis
5.6.0
See the version list below for details.
dotnet add package NexJob.Redis --version 5.6.0
NuGet\Install-Package NexJob.Redis -Version 5.6.0
<PackageReference Include="NexJob.Redis" Version="5.6.0" />
<PackageVersion Include="NexJob.Redis" Version="5.6.0" />
<PackageReference Include="NexJob.Redis" />
paket add NexJob.Redis --version 5.6.0
#r "nuget: NexJob.Redis, 5.6.0"
#:package NexJob.Redis@5.6.0
#addin nuget:?package=NexJob.Redis&version=5.6.0
#tool nuget:?package=NexJob.Redis&version=5.6.0
NexJob.Redis
High-throughput Redis storage provider for NexJob — the background job scheduler for .NET 8+.
Backed by StackExchange.Redis, this provider evaluates server-side Lua scripts to execute atomic, lock-free state transitions and priority queue operations at microsecond latencies.
Installation
dotnet add package NexJob.Redis
Quick Start
Register Redis storage in your dependency injection container before calling AddNexJob():
using NexJob;
using NexJob.Redis;
var builder = WebApplication.CreateBuilder(args);
// 1. Register Redis storage
builder.Services.AddNexJobRedis("localhost:6379,abortConnect=false");
// 2. Register NexJob core services
builder.Services.AddNexJob(options =>
{
options.Workers = 10;
options.Queues = ["default", "critical"];
});
Or provide a pre-configured IConnectionMultiplexer:
var multiplexer = ConnectionMultiplexer.Connect("localhost:6379");
builder.Services.AddNexJobRedis(multiplexer);
Distributed Throttling
[Throttle] limits how many jobs run concurrently per named resource. By default that limit applies per process; when you scale workers across several instances or containers you can enforce it cluster-wide with AddNexJobDistributedThrottle:
builder.Services.AddNexJobRedis("localhost:6379")
.AddNexJobDistributedThrottle();
Any job decorated with [Throttle("external-api", maxConcurrent: 50)] then runs at most 50 at a time across all worker nodes. Each running job holds an expiring entry that its node keeps refreshing, so slots left behind by a crashed node are reclaimed automatically (after three HeartbeatInterval periods); DistributedThrottleTtl caps how long one job may hold a slot. This is a concurrency limit, not a rate (per-minute) limit.
High-Throughput Batch Processing
For heavy ingestion workloads, enable batch processing to leverage server-side Lua scripts and vectorized acknowledgments:
builder.Services.AddNexJobRedis("localhost:6379,abortConnect=false");
builder.Services.AddNexJob(options =>
{
// Workers dynamically batch fetches to keep all idle slots busy (FetchBatchScript in 1 RTT)
options.Workers = 30;
options.PollingInterval = TimeSpan.FromMilliseconds(20);
// Commit successful jobs in asynchronous batches via AcknowledgeBatchScript
options.EnableBatchAcknowledgment = true;
});
Features
High-Throughput Batch Processing: Atomic batch claims and single-roundtrip acknowledgments via
FetchBatchScriptandAcknowledgeBatchScript.Microsecond Latency: Ultra-fast job enqueue and dispatch leveraging in-memory data structures.
Server-Side Lua Scripts: All complex state transitions (dequeuing, state commits, retry rescheduling) run atomically inside Redis, preventing race conditions.
Priority Queues: Implemented using Redis Sorted Sets (
ZSET) ordered by job priority and schedule timestamp.Global Distributed Throttle: Cluster-wide
[Throttle]concurrency limits with crash-safe, expiring slots.Job Index: A sorted-set index of all jobs serves dashboard lists, metrics and retention without scanning the keyspace; jobs that already exist are indexed once, on first use.
Runtime Settings Store: Hot-reloads queue concurrency and pause states from Redis hash keys.
Key Structure
All keys are namespaced with nexjob: to avoid collisions:
| Key Pattern | Data Structure | Purpose |
|---|---|---|
nexjob:jobs:{id} |
Hash (HSET) |
Job record properties and execution logs |
nexjob:queues:{queue} |
Sorted Set (ZSET) |
Ready jobs sorted by priority and arrival time |
nexjob:scheduled |
Sorted Set (ZSET) |
Delayed / scheduled jobs sorted by execution timestamp |
nexjob:processing |
Hash (HSET) |
In-flight jobs being processed by workers |
nexjob:recurring:all |
Hash (HSET) |
Recurring cron jobs and schedule configurations |
nexjob:servers:all |
Hash (HSET) |
Active worker nodes and heartbeats |
nexjob:settings |
Hash (HSET) |
Dynamic queue limits and pause status |
Connection Configuration Example
{
"ConnectionStrings": {
"Redis": "redis.production.cache.internal:6380,ssl=True,abortConnect=False,connectTimeout=5000"
}
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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 was computed. 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 was computed. 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. |
-
net8.0
- NexJob (>= 5.6.0)
- StackExchange.Redis (>= 2.8.16)
- System.Text.Encodings.Web (>= 8.0.0)
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 |
|---|---|---|
| 6.7.0 | 77 | 10/19/2026 |
| 6.6.0 | 87 | 10/18/2026 |
| 6.5.1 | 89 | 10/17/2026 |
| 6.5.0 | 83 | 10/17/2026 |
| 6.4.0 | 85 | 10/16/2026 |
| 6.3.0 | 91 | 10/12/2026 |
| 6.2.1 | 79 | 10/11/2026 |
| 6.2.0 | 83 | 10/10/2026 |
| 6.1.0 | 83 | 10/10/2026 |
| 6.0.0 | 85 | 10/9/2026 |
| 5.10.0 | 88 | 10/8/2026 |
| 5.9.0 | 92 | 10/5/2026 |
| 5.8.0 | 103 | 10/4/2026 |
| 5.7.0 | 87 | 10/1/2026 |
| 5.6.2 | 91 | 10/1/2026 |
| 5.6.1 | 90 | 9/30/2026 |
| 5.6.0 | 85 | 9/30/2026 |
| 5.5.0 | 93 | 9/25/2026 |
| 5.4.1 | 92 | 9/24/2026 |
| 5.4.0 | 95 | 9/24/2026 |