NexJob.Redis 6.7.0

dotnet add package NexJob.Redis --version 6.7.0
                    
NuGet\Install-Package NexJob.Redis -Version 6.7.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NexJob.Redis" Version="6.7.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NexJob.Redis" Version="6.7.0" />
                    
Directory.Packages.props
<PackageReference Include="NexJob.Redis" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add NexJob.Redis --version 6.7.0
                    
#r "nuget: NexJob.Redis, 6.7.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package NexJob.Redis@6.7.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=NexJob.Redis&version=6.7.0
                    
Install as a Cake Addin
#tool nuget:?package=NexJob.Redis&version=6.7.0
                    
Install as a Cake Tool

NexJob.Redis

High-throughput Redis storage provider for NexJob — the background job scheduler for .NET 8 and .NET 10.

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.QueuePrefix = "myapp"; // the "default" queue below is stored as "myapp.default"
    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 use 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 FetchBatchScript and AcknowledgeBatchScript.

  • Microsecond Latency: Enqueue and dispatch run against 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 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
Loading failed