Skip to content

Scheduler Core

libs/scheduler-core stays pure Java. It does not depend on Spring, Guice, HTTP, databases, or specific runtimes.

Capabilities

  • 6-field cron: second, minute, hour, day, month, week
  • fixed-rate scheduling
  • job-level IANA ZoneId
  • misfire policies: SKIP, FIRE_ONCE, CATCH_UP
  • concurrency policies: ALLOW, FORBID
  • local handler registry
  • replaceable Clock for tests

Time Rules

Jobs explicitly declare a ZoneId. Cron expressions are calculated in the job's local time, while runtime cursors are stored as UTC Instant values.

java
JobDefinition job = JobDefinition.builder()
        .id("new-york-daily-report")
        .name("New York Daily Report")
        .handlerName("reportHandler")
        .schedule(new CronSchedule("0 0 9 * * *"))
        .zoneId(ZoneId.of("America/New_York"))
        .build();

Misfire

PolicyMeaning
SKIPSkip missed fire times and advance to the next future time
FIRE_ONCECoalesce missed fire times into one compensation run
CATCH_UPCatch up missed fire times within configured limits

Released under the Apache-2.0 License.