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

Quartz — Enterprise Job Scheduling for Java

Feature-rich open-source job scheduling library for Java that supports cron expressions, clustering, and persistent job stores.

Prêt pour agents

Cet actif peut être lu et installé directement par les agents

TokRepo expose une commande CLI universelle, un contrat d'installation, le metadata JSON, un plan selon l'adaptateur et le contenu raw pour aider les agents à juger l'adaptation, le risque et les prochaines actions.

Native · 98/100Policy : autoriser
Surface agent
Tout agent MCP/CLI
Type
Skill
Installation
Single
Confiance
Confiance : Established
Point d'entrée
Quartz Overview
Commande CLI universelle
npx tokrepo install 6369fc9f-56e6-11f1-9bc6-00163e2b0d79

Introduction

Quartz is a widely adopted open-source job scheduling library for Java applications. It lets developers define jobs as simple Java classes and schedule them using cron expressions, intervals, or calendar-based triggers. Quartz can run embedded within an application server or as a standalone process, and supports clustering across multiple nodes with JDBC-backed job stores for persistence and failover.

What Quartz Does

  • Schedules jobs using cron expressions, fixed intervals, or calendar rules
  • Persists job definitions and triggers to a relational database via JDBC
  • Supports clustered execution where multiple scheduler instances share work
  • Provides listeners and plugins for job lifecycle events, logging, and history
  • Handles misfired triggers with configurable recovery policies

Architecture Overview

A Quartz Scheduler manages a JobStore that holds job definitions and trigger states. The RAMJobStore keeps everything in memory for fast single-node use, while the JDBCJobStore persists to a database for durability and clustering. A thread pool of configurable size executes jobs when their triggers fire. In clustered mode, multiple Scheduler instances use database row-level locking to coordinate trigger ownership, ensuring each job fires exactly once across the cluster.

Self-Hosting & Configuration

  • Add org.quartz-scheduler:quartz to your Maven or Gradle dependencies
  • Configure via quartz.properties with thread pool size, job store type, and data source
  • Define jobs by implementing the org.quartz.Job interface
  • Build triggers with the fluent TriggerBuilder and CronScheduleBuilder APIs
  • For clustering, set org.quartz.jobStore.isClustered = true and point all nodes at the same database

Key Features

  • Cron expressions support second-level granularity beyond standard Unix cron
  • JDBC job store provides persistence across application restarts
  • Built-in clustering with automatic failover and load balancing
  • Misfire handling policies let you skip, fire immediately, or reschedule missed triggers
  • Calendar exclusions can block job execution on holidays or maintenance windows

Comparison with Similar Tools

  • Spring @Scheduled — simple annotation-based cron for Spring apps; Quartz adds persistence and clustering
  • Temporal — durable workflow orchestration; Quartz is lighter for simple job scheduling
  • Celery Beat — Python periodic task scheduler; Quartz serves the Java/JVM ecosystem
  • Hangfire — .NET background jobs; Quartz is the Java equivalent with JDBC stores
  • Airflow — DAG-based workflow orchestration; Quartz handles individual recurring jobs

FAQ

Q: Can Quartz run in a Spring Boot application? A: Yes. Spring Boot has built-in auto-configuration for Quartz via the spring-boot-starter-quartz dependency.

Q: How does Quartz handle a missed job trigger? A: Configurable misfire instructions let you fire immediately, discard the missed run, or reschedule to the next valid time.

Q: Does Quartz support distributed execution across servers? A: Yes. Configure JDBC job store with clustering enabled and all nodes sharing the same database.

Q: What databases does the JDBC job store support? A: Quartz provides SQL scripts for PostgreSQL, MySQL, Oracle, SQL Server, H2, and other databases.

Sources

Fil de discussion

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

Actifs similaires