Years ago, we covered Spring Boot Scheduling with @Scheduled—and for single-instance cron jobs that take two seconds and carry zero side effects, @Scheduled is still hard to beat.
Then your application grows up. You deploy three replicas behind Kubernetes, add a four-step monthly invoicing or agentic LLM research workflow (calculate usage → generate PDF or call an LLM → charge card → send email), and a pod gets evicted right after step 3. With naive retries, the next worker starts from line one—charging the customer twice or burning a second round of LLM tokens.
Featured on A Bootiful Podcast (November 19, 2026) with JobRunr creator Ronald Dehuysser, JobRunr 9 (latest patch 9.0.5, November 17, 2026) tackles this exact class of distributed Java problems using the PostgreSQL database you already run. In this guide, we will wire up jobrunr-spring-boot-4-starter:9.0.5, make multi-step pipelines crash-proof with JobContext.runStepOnce(...), unpack v9’s new Gantt Job History charts and zero-config 7 ms PostgreSQL LISTEN/NOTIFY triggering, flag the critical v9.0.5 dashboard security patch (GHSA-fm36-5jx4-vwhf), and close with a crisp architecture matrix comparing Atomikos XA vs. JobRunr 9 vs. Temporal.
1. Spring Boot 4 + PostgreSQL Setup (v9.0.5)
JobRunr 9 ships a dedicated Spring Boot 4 starter on Maven Central (org.jobrunr:jobrunr-spring-boot-4-starter:9.0.5) and persists job state directly in your existing PostgreSQL schema—no ZooKeeper, Kafka, or separate scheduler cluster required.
Security Note: Always target
9.0.5or newer (never9.0.0–9.0.4). Released November 17, 2026,v9.0.5fixesGHSA-fm36-5jx4-vwhf, a path traversal vulnerability in the dashboard’sStaticFileHttpHandlerthat allowed reading classpath resources when the dashboard was exposed without authentication. Even on9.0.5, bind the dashboard tolocalhostor put it behind authentication.
// build.gradle.kts
dependencies {
implementation("org.springframework.boot:spring-boot-starter-webmvc")
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("org.jobrunr:jobrunr-spring-boot-4-starter:9.0.5")
runtimeOnly("org.postgresql:postgresql")
}
# application.yml
jobrunr:
background-job-server:
enabled: true
# JobRunr Pro v9 adaptive scaling & prefetch options:
# work-distribution-strategy: prefetch-queue
# worker-capacity-policy: self-learning
dashboard:
enabled: true
port: 8000 # Never expose publicly without authentication (GHSA-fm36-5jx4-vwhf)
jobs:
metrics:
micrometer-observability:
enabled: true
otel-observability:
enabled: true
2. Crash-Proof Multi-Step Jobs with JobContext.runStepOnce
The standout pattern for modern billing jobs and multi-step AI pipelines is JobContext.runStepOnce(stepId, task). Each completed step persists a checkpoint (jr_step_<stepId>) and its serialized return value alongside the job record in PostgreSQL.
If step 3 fails due to a transient downstream timeout—or a Kubernetes node drains mid-execution—JobRunr’s exponential backoff retry resumes the job, immediately skips steps 1 and 2, replays their persisted return values, and executes strictly from step 3 onward.
package com.ghostprogrammer.jobs;
import org.jobrunr.jobs.annotations.Job;
import org.jobrunr.jobs.context.JobContext;
import org.springframework.stereotype.Service;
@Service
public class InvoiceWorkflowService {
private final UsageService usageService;
private final PdfRenderer pdfRenderer;
private final PaymentGateway paymentGateway;
private final EmailClient emailClient;
public InvoiceWorkflowService(UsageService usageService,
PdfRenderer pdfRenderer,
PaymentGateway paymentGateway,
EmailClient emailClient) {
this.usageService = usageService;
this.pdfRenderer = pdfRenderer;
this.paymentGateway = paymentGateway;
this.emailClient = emailClient;
}
@Job(name = "Invoice %1 for customer %0", retries = 5)
public void generateAndChargeInvoice(String customerId, String billingPeriod, JobContext jobContext)
throws Exception {
String invoiceId = "INV-" + billingPeriod + "-" + customerId;
// Step 1: Expensive aggregation—skipped on retry once checkpointed
long billableUnits = jobContext.runStepOnce("calculate-usage",
() -> usageService.calculateUnits(customerId, billingPeriod));
// Step 2: PDF generation (or expensive LLM synthesis step)
String pdfStorageKey = jobContext.runStepOnce("render-pdf",
() -> pdfRenderer.renderAndUpload(invoiceId, billableUnits));
// Step 3: Always pair external side effects with a deterministic idempotency key
String receiptId = jobContext.runStepOnce("charge-card",
() -> paymentGateway.charge(customerId, invoiceId, billableUnits));
// Step 4: Final customer notification
jobContext.runStepOnce("send-email",
() -> emailClient.sendInvoice(customerId, pdfStorageKey, receiptId));
}
}
One crucial idempotency rule: If the JVM crashes inside charge-card after Stripe approves the charge but milliseconds before JobRunr commits jr_step_charge-card to PostgreSQL, step 3 will run again on retry. Passing a deterministic idempotency key (invoiceId) to external payment or API providers closes that last narrow window cleanly—and always keep stepId strings stable across deployments.
3. Opening the Black Box: Gantt Job History Charts & Dark Mode
Ronald Dehuysser described JobRunr 9 around one core goal: “opening the black box of background processing.”
In both JobRunr OSS (LGPL-3.0+) and JobRunr Pro, every job detail page now toggles between the classic Timeline list and a zero-config Job History Chart—a Gantt-style execution graph across attempts and runStepOnce checkpoints:
- Hollow diamonds show checkpointed steps skipped cleanly on retry.
- Red bars pinpoint exact failed steps.
- Compact vs. Detailed and Compressed vs. Linear time axes immediately distinguish slow business code from long queue wait times.
Alongside system-aware Light/Dark dashboard themes, v9 also adds proactive dashboard and log warnings whenever serialized job arguments grow too large (a classic anti-pattern when someone passes a 10 MB payload instead of a database ID).
4. Zero-Config 7 ms PostgreSQL LISTEN/NOTIFY & Adaptive Workers (Pro v9)
In earlier JobRunr Pro releases, instant job triggering relied on UDP multicast—which almost every Kubernetes CNI and managed cloud VPC blocks by default, forcing silent fallback to 15-second database polling.
JobRunr Pro v9 replaces that with a pluggable EventBus (EventTransport) that automatically enables PostgresEventTransport (LISTEN/NOTIFY) whenever your StorageProvider is PostgreSQL—no extra beans, firewall tickets, or properties needed. On JobRunr’s published benchmark (20 jobs enqueued 1.5s apart on an idle server), the latency drop is dramatic:
| Triggering Mode | Median Enqueue → Processing | Max Enqueue → Processing |
|---|---|---|
PostgreSQL LISTEN/NOTIFY (Zero-Config, Pro v9) | 7 ms | 19 ms |
| 15-Second Polling Fallback (Multicast Blocked) | 7.7 s | 14.5 s |
(Operational tip: each worker holds 1 dedicated listener connection, background polling remains active as a safety net, and teams behind PgBouncer in transaction-pooling mode should route the listener over a direct session-mode connection.)
Three more Pro v9 additions are built for heavy production clusters:
JobPrefetchQueue(work-distribution-strategy=prefetch-queue): Prefetches jobs in chunks ahead of worker completion so idle threads never stall on per-job DB round trips.SelfLearningWorkerCapacityPolicy(worker-capacity-policy=self-learning): Continuously monitors DB connection wait time, CPU load, and JVM memory pressure to throttle worker concurrency automatically under strain.- Pausable Batch Jobs (
BatchJobManager.pauseBatchJob(...)): Lets operators or automated circuit breakers pause a failing 50,000-job batch mid-flight via UI, REST, or Java without losing already-completed children.
5. Architecture Decision Matrix: Atomikos XA vs. JobRunr 9 vs. Temporal
With A Bootiful Podcast covering Temporal, Atomikos XA, and JobRunr 9 back-to-back in November 2026, it is worth clarifying exactly where each tool shines in a Spring Boot 4 architecture:
| Workload Tier | Recommended Engine | Primary Strength | Operational Footprint |
|---|---|---|---|
| Tier 1: Sub-second Multi-DB / DB+Broker Strict ACID | Atomikos XA (transactions-spring-boot4-starter:6.0.1) | Atomic 2PC commit/rollback under @Transactional; zero dirty reads or Saga compensation logic. | Embedded JAR + shared RDBMS LogCloud for stateless pods. |
| Tier 2: DB-Backed Cron, Batch & Multi-Step Durable Jobs | JobRunr 9 (jobrunr-spring-boot-4-starter:9.0.5) | runStepOnce checkpoints, Gantt Charts, 7 ms PG LISTEN/NOTIFY, and adaptive workers. | Zero new infra—runs right on your existing PostgreSQL DB. |
| Tier 3: Multi-Day Stateful Sagas, Polyglot Workers & Governed AI Harnesses | Temporal (temporal-spring-boot-starter:1.40.0) | Full event-sourced deterministic replay, zero-compute human-in-the-loop waits, polyglot workflows. | Dedicated Temporal Server cluster (or Temporal Cloud). |
6. Upgrading from JobRunr 8? Quick Breaking-Change Checklist
- Replace removed v8 deprecated methods:
useMicroMeter→JobRunrConfiguration#useMetrics,withDetails→withJobLambda, and ProwithQueue→withPriorityQueue. - Remove legacy
jobrunr.multicast-group-addressconfig (replaced by pluggableEventTransport). - Test fixtures now require JDK 17+, and v9 marks the final OSS major release supporting Java 8.
- Pin directly to
9.0.5to pick up theGHSA-fm36-5jx4-vwhfdashboard patch.
Conclusion
Most Spring Boot teams do not need a heavy distributed workflow cluster just to make nightly billing jobs, webhook retries, and multi-step AI pipelines survive pod restarts. JobRunr 9.0.5 gives you checkpointed durable steps (runStepOnce), visual Gantt execution debugging, and—on PostgreSQL Pro clusters—7 ms instant triggering without adding a single new moving piece to your infrastructure diagram.
Discover more from GhostProgrammer - Jeff Miller
Subscribe to get the latest posts sent to your email.

