Esta página se muestra en inglés. Una traducción al español está en curso.
ScriptsJul 13, 2026·3 min de lectura

Quartz.NET — Enterprise Job Scheduler for .NET

A full-featured, open-source job scheduling library for .NET that supports cron expressions, persistent job stores, and clustering for reliable background task execution.

Listo para agents

Instalación lista para agent

Este activo puede instalarse después de elegir el runtime, revisar el plan y ejecutar el comando correspondiente.

Native · 98/100Política: permitir
Superficie agent
Cualquier agent MCP/CLI
Tipo
Skill
Instalación
Single
Confianza
Confianza: Established
Entrada
Quartz.NET Overview
Comando de instalación directa
npx -y tokrepo@latest install 0dee5dcb-7e95-11f1-9bc6-00163e2b0d79 --target codex

Ejecutar después de confirmar el plan con dry-run.

Introduction

Quartz.NET is a .NET port of the popular Java Quartz scheduler. It provides enterprise-grade job scheduling with support for cron triggers, calendar exclusions, persistent job stores, and clustered execution across multiple application instances.

What Quartz.NET Does

  • Schedules jobs using cron expressions, simple intervals, or calendar-based triggers
  • Persists job and trigger state to SQL databases for durability across restarts
  • Supports clustered scheduling where multiple nodes share a job store without duplicate execution
  • Manages job dependencies, retry policies, and misfire handling strategies
  • Integrates with ASP.NET Core dependency injection and hosted services

Architecture Overview

Quartz.NET has three core abstractions: Jobs (the work to execute), Triggers (when to execute), and the Scheduler (the orchestrator). The scheduler runs as a hosted service and checks triggers against the current time. In clustered mode, an ADO.NET job store with row-level locking ensures only one node fires each trigger. An in-memory store is available for simpler single-instance scenarios.

Self-Hosting & Configuration

  • Install via NuGet: dotnet add package Quartz and Quartz.Extensions.Hosting
  • Register with AddQuartz() and AddQuartzHostedService() in Program.cs
  • Use UsePersistentStore() with SQL Server, PostgreSQL, or SQLite for durable scheduling
  • Enable clustering with q.UsePersistentStore(s => s.UseProperties = true) and shared DB
  • Configure misfire policies per trigger to handle delayed or missed firings

Key Features

  • Cron expression support identical to Unix cron with seconds-level precision
  • Persistent job stores survive application restarts and deployments
  • Cluster-safe scheduling prevents duplicate job execution across instances
  • Calendar exclusions for holidays, maintenance windows, and business hours
  • Listener interfaces for monitoring job execution, triggers, and scheduling events

Comparison with Similar Tools

  • Hangfire — Focuses on background jobs with a dashboard; Quartz.NET excels at complex scheduling with cron and calendars
  • Celery — Python distributed task queue; Quartz.NET serves the same role in .NET
  • Azure Functions Timer — Cloud-only; Quartz.NET runs on-premises or in any hosting environment
  • Coravel — Simpler .NET scheduler; Quartz.NET offers clustering and persistent stores for enterprise needs

FAQ

Q: Does Quartz.NET support dependency injection? A: Yes, the Quartz.Extensions.Hosting package integrates fully with Microsoft DI.

Q: Can jobs run across multiple servers? A: Yes, enable clustered mode with a shared database and Quartz.NET coordinates execution.

Q: What happens if a job fails? A: You can configure retry policies, and jobs can request re-execution by throwing a JobExecutionException.

Q: How precise is the scheduling? A: Triggers support second-level precision with cron expressions like 0/30 * * * * ? for every 30 seconds.

Sources

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados