Durable background jobs and scheduling for Java
Threadmill runs your background work across a cluster of application nodes, on the database you already operate. Priority queues, transactional enqueue, per-key concurrency and a secured dashboard are part of the open-source core.
Apache 2.0 · PostgreSQL, Oracle, Redis · Spring Boot starter
A job is a payload and a handler
public record SendEmail(String to, String subject) implements JobPayload {}
@Component
@Job(queue = "email", timeout = "PT2M", maxAttempts = 5)
final class SendEmailHandler implements JobHandler<SendEmail> {
@Override
public void run(SendEmail payload, JobExecutionContext ctx) {
ctx.log("sending " + payload.subject() + " to " + payload.to());
}
}
// Anywhere in your application:
jobs.enqueue(SendEmailHandler.class, new SendEmail("a@b.com", "Welcome"));Payloads are typed records. Threadmill checks the handler and payload pair when you enqueue, so mismatches fail at the call site and not at three in the morning.
Placeholder: dashboard screenshot
Fire-and-forget jobs and cron schedules, in one engine
Most teams run one library for scheduled tasks and another for background jobs. Threadmill does both: enqueue now, schedule for later, or run on a cron or fixed interval. Recurring tasks have an explicit missed-run policy, so you decide whether a task that was due during downtime runs once or catches up on every missed firing.
The features you would otherwise license
These are in the Apache 2.0 core today.
Priority queues and lanes. Named queues with their own worker capacity, priorities within a queue, and weighted queue families such as tenant:*.
Transactional enqueue. Commit the job in the same database transaction as your business data on PostgreSQL and Oracle.
Per-key concurrency. Exclusive or shared limits per key, enforced when a job is claimed and inherited through workflows.
Mutexes and deduplication. Cluster-wide leases, and producer-side dedup so concurrent enqueues collapse into one job.
Timeouts and check-ins. A per-attempt timeout, plus a no-progress timeout for long jobs that report they are still alive.
Fast pickup. New jobs wake idle workers on PostgreSQL and Redis; polling is only the fallback.
Retries you control. Per job, per exception type, or a global default.
A secured dashboard. Mounted in your Spring Boot app, authenticated by default, with sensitive job details redacted unless you allow them.
Built on virtual threads
Every job runs on a virtual thread, and per-job context travels in scoped values instead of thread-locals. A worker that waits on a database or an HTTP call does not hold an operating-system thread, so you size workers for your workload and your connection pool, not for a thread pool.
At-least-once, and we say so first
Threadmill delivers every job at least once. After a node crash or a datastore outage, a job can run a second time, so handlers must be idempotent. Most database-backed job libraries work this way; we put it at the top of the documentation and give you a transactions guide that explains exactly what is atomic on each store.
Tested like infrastructure
Every store, including the in-memory one, passes the same contract suite. A soak harness drives sustained load while it checks invariants live, restarts nodes, and pauses the datastore mid-run to prove the engine recovers by itself.
Runs on what you already run
PostgreSQL. The primary production store. Migrations run automatically, or emit the SQL for Flyway or Liquibase.
Oracle Database. Standard JDBC, minimal privileges, resumable migrations.
Redis. Standalone, Sentinel and Cluster. Every state change is one atomic script.
In-memory. For tests and local development, held to the same contract as the others.
See it, measure it, trace it
The dashboard shows queues, nodes, jobs and recurring tasks, and lets operators pause a queue, retry or requeue a job, and edit a schedule, with every action permission-checked and sent to your audit log. Micrometer metrics and OpenTelemetry tracing are separate modules you add when you want them.
Placeholder: dashboard screenshot, operator actions
In production
LingoHub uses Threadmill for background job processing.

Add it to your build
implementation("com.hemju.threadmill:threadmill-spring-boot:1.1.1")
implementation("com.hemju.threadmill:threadmill-store-postgres:1.1.1")<dependency>
<groupId>com.hemju.threadmill</groupId>
<artifactId>threadmill-spring-boot</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>com.hemju.threadmill</groupId>
<artifactId>threadmill-store-postgres</artifactId>
<version>1.1.1</version>
</dependency>| Requirement | Supported |
|---|---|
| Current release | 1.1.1 |
| Java | 25 |
| Spring Boot | 4.x |
| PostgreSQL | 18 or later |
| Oracle Database | 19c or later |
| Redis | 7.4 or later; standalone, Sentinel or Cluster |
| License | Apache 2.0 |
Start with one job
Port one real job, run it twice to prove it is idempotent, then move the rest.