NexJob
Predictable and observable background job processing for .NET 8.
NexJob gives you predictable execution, built-in retries, deadline enforcement, and operational visibility — without the complexity of traditional schedulers. If a job must run, fail safely, and leave a trace, NexJob handles it as a first-class concern.
Quick Start
dotnet add package NexJob
// Program.cs — register NexJob and scan for jobs
builder.Services.AddNexJob()
.AddNexJobJobs(typeof(Program).Assembly);
// Define a job
public sealed class HelloJob : IJob
{
public Task ExecuteAsync(CancellationToken ct)
{
Console.WriteLine("Hello from NexJob!");
return Task.CompletedTask;
}
}
// Enqueue from anywhere
var scheduler = app.Services.GetRequiredService<IScheduler>();
await scheduler.EnqueueAsync<HelloJob>();
See Getting Started for a complete walkthrough.
When Should I Use NexJob?
NexJob is a good fit when you need:
- Predictable execution — retries, deadlines, and failure handling built into the model
- Deadline enforcement — jobs expire if not executed in time (
deadlineAfter)
- Dead-letter handling — automatic fallback when all retries are exhausted
- Operational visibility — built-in dashboard, traces, and metrics
- Low-latency dispatch — wake-up channel for near-zero latency local enqueue
- Free storage providers — PostgreSQL, SQL Server, Redis, MongoDB, InMemory
- Event-driven triggers — enqueue jobs from Azure Service Bus, SQS, RabbitMQ, Kafka, Google Pub/Sub, Salesforce Pub/Sub API, or Salesforce Streaming (CometD)
NexJob vs Alternatives
| Feature |
NexJob |
Hangfire |
Quartz.NET |
| Execution model |
Stateless dispatcher, atomic commits |
Polling-based |
Trigger-based |
| Retry & dead-letter |
Built-in, configurable |
Plugin required |
Manual |
| Deadline enforcement |
Built-in (deadlineAfter) |
Plugin required |
Manual |
| Scheduling |
Delay, one-shot and cron recurring; dispatched by polling with a local wake-up |
Polling |
Cron + calendar |
| Dashboard |
Built-in, standalone |
Paid |
None |
| OpenTelemetry |
Built-in |
Plugin required |
Plugin required |
When NOT to use NexJob:
- You need distributed job execution across untrusted networks
- You require sub-second scheduling precision (NexJob polls at configurable intervals)
- You need a full-featured enterprise scheduler with calendar-based triggers
Core Features
Job Model
IJob / IJob<T> — simple and structured execution
- Recurring jobs — via code or
appsettings.json
- Continuations — chain jobs with parent/child relationships
- External Triggers — enqueue jobs from message brokers automatically
Reliability
- Retry policies — a global delay policy plus per-job
[Retry] with configurable exponential backoff
deadlineAfter — jobs expire if not executed in time
IDeadLetterHandler<T> — automatic fallback on permanent failure
- Idempotency —
DuplicatePolicy controls re-enqueue behavior
Operations
- OpenTelemetry — traces and metrics built-in
- Dashboard — standalone UI for monitoring
[Throttle] — concurrency limits per resource
Extensibility
- Job Filters —
IJobExecutionFilter middleware pipeline for cross-cutting behaviour
Documentation
Start here
Build & schedule
Operate in production
Reference
Next Steps
v5.6.1 · Changelog · GitHub