NexJob.SqlServer 5.2.0

dotnet add package NexJob.SqlServer --version 5.2.0
                    
NuGet\Install-Package NexJob.SqlServer -Version 5.2.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.SqlServer" Version="5.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NexJob.SqlServer" Version="5.2.0" />
                    
Directory.Packages.props
<PackageReference Include="NexJob.SqlServer" />
                    
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.SqlServer --version 5.2.0
                    
#r "nuget: NexJob.SqlServer, 5.2.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.SqlServer@5.2.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.SqlServer&version=5.2.0
                    
Install as a Cake Addin
#tool nuget:?package=NexJob.SqlServer&version=5.2.0
                    
Install as a Cake Tool

NexJob.SqlServer

Microsoft SQL Server storage provider for NexJob — the background job scheduler for .NET 8+.

Backed by Microsoft.Data.SqlClient and Dapper, this provider uses WITH (UPDLOCK, READPAST, ROWLOCK) hints for atomic, lock-contention-free job fetching across multiple distributed worker nodes.


Installation

dotnet add package NexJob.SqlServer

Quick Start

Register SQL Server storage in your dependency injection container before calling AddNexJob():

using NexJob;
using NexJob.SqlServer;

var builder = WebApplication.CreateBuilder(args);

// 1. Register SQL Server storage
builder.Services.AddNexJobSqlServer(
    builder.Configuration.GetConnectionString("NexJobConnection")!);

// 2. Register NexJob core services
builder.Services.AddNexJob(options =>
{
    options.Workers = 10;
    options.Queues = ["default", "critical"];
});

Features

  • Atomic Job Dispatching: Employs WITH (UPDLOCK, READPAST, ROWLOCK) locking hints to allow multiple workers to concurrently dequeue jobs without blocking each other or causing deadlocks.
  • Automatic Schema Migration: Applies database schema migrations automatically on startup using sp_getapplock, guaranteeing safe concurrent execution in clustered environments.
  • Idempotency Enforcement: Enforces strict and conditional deduplication policies (DuplicatePolicy) indexed on idempotency_key.
  • Runtime Settings Store: Persists queue concurrency rules and runtime settings in nexjob_settings.
  • Dashboard Read Replica Support: Route dashboard metrics and monitoring queries to an Azure SQL / SQL Server read-scale replica.

Read Replica Configuration

To offload dashboard queries to a read replica (such as Azure SQL Database Read-Scale Out or Always On Availability Groups):

builder.Services.AddNexJobSqlServer(primaryConnectionString);

builder.Services.AddNexJob(options =>
{
    options.Workers = 10;
})
.UseDashboardReadReplica(readReplicaConnectionString);

Database Tables

The provider automatically manages the following tables in the configured database:

Table Purpose
nexjob_jobs Job records, serialized arguments, execution state, retries, and errors
nexjob_recurring Recurring cron schedules and execution state
nexjob_heartbeats Active worker node registration and health status
nexjob_settings Dynamic runtime settings and queue controls

Connection String Example

{
  "ConnectionStrings": {
    "NexJobConnection": "Server=tcp:sqlserver.database.windows.net,1433;Initial Catalog=nexjob;User ID=admin;Password=secret;Encrypt=True;TrustServerCertificate=False;"
  }
}
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 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. 
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
5.2.0 0 9/20/2026
5.1.0 36 9/17/2026
5.0.0 43 9/17/2026
4.0.1 42 9/17/2026
4.0.0 133 4/21/2026
3.0.0 118 4/16/2026
2.0.0 122 4/14/2026
1.0.0 115 4/8/2026
0.8.0 116 4/8/2026
0.7.0 121 4/7/2026
0.6.0 117 4/3/2026
0.5.2 116 4/1/2026
0.5.1 124 4/1/2026
0.5.0 115 3/31/2026
0.4.0 119 3/31/2026
0.3.2 131 3/28/2026
0.3.1 152 3/28/2026
0.3.0 112 3/27/2026
0.2.0 121 3/27/2026
0.0.0-alpha.0 38 9/17/2026