PROVIDER - Distributed Job Scheduler

XXL-JOB

XXL-JOB is a lightweight distributed scheduler where an admin console configures cron jobs and routes them to embedded executors, with ten routing strategies, sharding broadcast and retries; GPL-3.0 with no licence fee.

Automation China 2026.11.30 1 views
3.9pts
Advertisement

Service Overview

XXL-JOB is a lightweight distributed job scheduler: an admin console configures tasks, cron expressions and routing strategies, while executors ship as an SDK embedded in business applications, registering with the admin and accepting triggers. It targets Java teams that want to replace scattered scheduled threads and system cron with centrally managed schedules.

The project is maintained by Xu Xueli, licensed under GPL-3.0, with roughly 30,000 stars and the current 3.5.x line released in October 2026. Admin and executors communicate through a built-in registry, and several admin instances coordinate via a database lock to avoid duplicate triggers.

Key Strengths

  • The admin console manages tasks, so cron expressions, parameters and routing leave application code.
  • Executors embed as an SDK in Spring apps, letting existing bean methods be scheduled with an annotation.
  • Ten routing strategies cover round robin, failover, consistent hashing and sharding broadcast.
  • Retries, timeout control and blocking policies are set per task, preventing pile-ups from redoing work.
  • GPL-3.0 licensing means no fee and no task cap, backed by reasonably complete community docs.

Limitations

  • GPL-3.0 is copyleft, so redistributing a closed-source product that embeds it needs legal review.
  • There is no native DAG dependency, so task chains rely on timing gaps or manual wiring.
  • Sharding broadcast distributes work but leaves result aggregation to your own code.
  • The admin relies on the database for registry and locks, so an outage stops triggering.
  • The UI is basic, lacking a resource centre, multi-tenancy and fine-grained audit for large organisations.

Product Ecosystem

The admin triggers and routes, executors embedded in apps run the work Admin console task config, cron and routing Registry and callback executor heartbeats, result reports Executor inside the business application Task modes: bean methods · GLUE scripts (shell, Python and more) beans register by annotation; GLUE scripts hot-reload from the console Database: task config, registry and scheduling logs multiple admin instances coordinate through a database lock Alerting: failures and timeouts go out by email to the recipients set per task Both admin and executors scale horizontally, with executors organised into groups (scope: official docs, 2026-11) Current line 3.5.x, implemented in Java, licensed under GPL-3.0
Figure 1: Admin and executor collaboration (scope: official documentation, 2026-11)

XXL-JOB splits scheduling from execution: the admin decides when to fire and which executor receives the trigger, and the executor only runs and reports. Because executors live inside business applications, task code ships with the application release.

Task modes and configuration

Tasks come as beans or GLUE scripts. Bean mode registers annotated methods in the application and passes parameters plus shard information through a context; GLUE mode keeps shell or Python scripts in the console, hot-reloading them without an application release.

Routing strategies and sharding broadcast

Each task picks a routing strategy: round robin, random, consistent hashing, failover, busy transfer and others. Sharding broadcast splits one trigger across every machine in the executor group, with each machine handling its own shard index, which fits table scans and reconciliation.

Blocking policies, retries and timeouts

Blocking policies decide what happens while a previous run is still active: serial execution on the same machine, discard later triggers or terminate the running one. Retry counts and timeouts are set per task, and the admin interrupts and records runs that exceed the limit.

Registry, high availability and alerts

Executors register on startup, and multiple admins negotiate through a database lock so a task is not triggered twice. Alerting is email-based with per-task recipients, and channels needing instant delivery can point at the callback pattern described in webhook signature verification.

Joining business systems

Because executors run inside business applications, tasks reach existing services and data access layers directly. Cross-system triggers can call the other side's API, or that system can fire tasks through the admin OpenAPI.

Use Cases

  • Good fit|Scheduled work in Java applications: move scattered scheduled threads into a central console.
  • Good fit|Batch scans and reconciliation: sharding broadcast lets several machines process separate ranges.
  • Good fit|Script-based operations: GLUE tasks run shell and Python without an application release.
  • Good fit|Jobs needing failover: routing hands the trigger to a healthy node when one fails.
  • Evaluate|Flows needing DAG dependencies: there is no native dependency graph; use another orchestrator.
  • Evaluate|Redistributing closed-source products: GPL-3.0 copyleft needs a legal review.
  • Evaluate|Second-level or faster triggers: scheduling precision is designed around minutes.

Open Source License & Deployment Cost

Two policy families decide which machine runs and what happens on pile-up Routing strategies (selection) round robin · random · consistent hash failover · busy transfer least frequently used · least recently used first · last · sharding broadcast chosen per task, spread inside the executor group Blocking policies serial: queue runs in order discard later: keep the running one overwrite: stop the old, start the new prevents duplicate work from pile-ups paired with timeouts and retry counts Licence: GPL-3.0, free to self-host, with no cap on tasks or executors Cost items: admin hosts and database, application servers hosting executors, operations effort (scope: official documentation and repository licence, 2026-11)
Figure 2: Routing and blocking policy combination (scope: official documentation, 2026-11)

No commercial licence is required, so budget goes to hosts and people: two admin instances usually, a database that may be shared, and executors that ship with applications.

Item Billing Size and volume Notes
Software licence free unlimited tasks and executors GPL-3.0, commercial use and modification allowed; redistributing a closed-source product needs review
Admin hosts billed by your cloud or colocation two instances in production, sized by trigger volume and logs multiple admins rely on a database lock, and clocks must be aligned to avoid duplicate triggers
Database reuse an existing instance or provision one MySQL, sized by scheduling log retention task config, executor registry and logs all live here
Executor resources scales with applications memory sized by shard volume and parallelism every executor needs connectivity to the data source used by its shards
Operations effort internal team time deployment, upgrades, log purging, alert upkeep scheduling logs grow quickly, so archive or purge on a schedule
Alert channel usually free a mail server or your own SMTP relay instant channels can call an external webhook from the task

Back up the database and check the release notes before upgrading; admin and executor versions must stay within the supported range.

FAQ

  • How does it differ from Quartz? Quartz is an in-process scheduling library where jobs live and die with the application, and configuration spreads across applications. XXL-JOB makes scheduling a separate service with centrally managed tasks, observable trigger records once executors register, and better fit for many applications and teams.
  • Does GPL-3.0 affect commercial use? Internal use is unaffected and modified source need not be published. Distributing a system containing XXL-JOB as a closed-source product raises licence obligations, so common practice keeps it internal without shipping binaries, or obtains legal advice on where the boundary sits.
  • How are sharding results aggregated? Sharding broadcast only distributes work, with each executor handling its own index range, and results are not collected automatically. A common pattern writes shard output into one table or object store keyed by shard id, then a follow-up task or report reads them while staying idempotent.
  • Will scheduling logs fill the database? They grow with trigger volume. Purge on a retention schedule or archive history to cold storage, and avoid logging large parameter payloads. The purge script itself can run as a scheduled task, which keeps maintenance off the manual list.
  • Can it integrate with non-Java systems? Yes. GLUE tasks run shell and Python scripts, and executors register and report over HTTP. Non-Java services can be called from a task, or call the admin OpenAPI to trigger tasks, leaving scheduling and observability in the centre while services only execute.

Integration & Code Examples

Register a bean task in a Spring application

import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.springframework.stereotype.Component;

@Component
public class OrderSyncJob {

    @XxlJob("orderSyncHandler")
    public void orderSync() throws Exception {
        // shard parameters come from the admin, splitting work across machines
        int shardIndex = XxlJobHelper.getShardIndex();
        int shardTotal = XxlJobHelper.getShardTotal();
        XxlJobHelper.log("shard {}/{} start", shardIndex, shardTotal);

        // business logic: pull orders for this shard and write downstream
        boolean ok = syncOrders(shardIndex, shardTotal);
        if (!ok) {
            XxlJobHelper.handleFail("sync failed on shard " + shardIndex);
            return;
        }
        XxlJobHelper.handleSuccess("shard done");
    }

    private boolean syncOrders(int index, int total) {
        return true;
    }
}

Configure the executor and trigger a task

# application.properties: register with the admin and declare the executor name
xxl.job.admin.addresses=http://scheduler-a:8080/xxl-job-admin,http://scheduler-b:8080/xxl-job-admin
xxl.job.executor.appname=order-service
xxl.job.executor.port=9999
xxl.job.accessToken=change-me
# trigger once through the OpenAPI, passing parameters defined on the task
curl -X POST "http://scheduler-a:8080/xxl-job-admin/api/trigger" \
  -H "XXL-JOB-ACCESS-TOKEN: ${XXL_TOKEN}" \
  -d "jobId=12&executorParam=date%3D2026-11-30&addressList="

The executor name must match the one registered in the console, otherwise the task fails with no available node.

Community & Resources

Visit XXL-JOB Website → https://www.xuxueli.com/xxl-job/
Visit Website ↗