Cette page est affichée en anglais. Une traduction française est en cours.
ScriptsJul 13, 2026·3 min de lecture

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.

Prêt pour agents

Installation agent prête

Cet actif peut être installé après choix du runtime, vérification du plan et exécution de la commande adaptée.

Native · 98/100Policy : autoriser
Surface agent
Tout agent MCP/CLI
Type
Skill
Installation
Single
Confiance
Confiance : Established
Point d'entrée
Quartz.NET Overview
Commande d'installation directe
npx -y tokrepo@latest install 0dee5dcb-7e95-11f1-9bc6-00163e2b0d79 --target codex

À exécuter après confirmation du plan en 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

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires