Spring Batch Cheat Sheet
|
This section documents the current Spring Batch line — 6.0.x, on Spring Framework 7 and Spring Boot 4.1.x, with a Java 17+ baseline — as published at the Spring Batch reference documentation. No specific patch version is pinned. Some surfaces (Spring Cloud Task and Spring Cloud Data Flow orchestration, the deployer-based partition handler, and JSR-352) are linked, not documented in depth. This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production. |
A single-page, colour-coded summary of the Spring Batch essentials — the
Job / JobInstance / JobExecution / Step / StepExecution domain model, the read/process/write chunk
loop and the commit interval, the new JobBuilder(…) and new StepBuilder(…).chunk(…) skeletons, the
six metadata table names, the spring.batch.* properties, the "leave @EnableBatchProcessing off under Spring
Boot" rule, the .faultTolerant().skip(…).retry(…) skeleton, the .on("FAILED").to(…) step-flow
transition syntax, the partitioning topology, the spring-batch-test JobOperatorTestUtils one-liners, and
the spring.batch.job / spring.batch.step Micrometer meter names — handy for quick memorization or as a
printable desk reference.
For the full explanation, every option, and additional examples, see the dedicated pages:
Getting started — What Spring Batch is & running a first job.
Architecture & domain language — Architecture & processing strategies,
Jobs, instances & parameters, and
Steps, executions & the ExecutionContext.
Configuring & running jobs — Infrastructure configuration, The job repository & metadata schema, Configuring a job, Running a job, and Stopping, restart & recovery.
Steps — Chunk-oriented processing, Tasklet steps, Fault tolerance: skip & retry, and Step flow & listeners.
`ItemReader`s, `ItemProcessor`s & `ItemWriter`s — `ItemReader`s: files & XML/JSON, `ItemReader`s: databases, `ItemProcessor`s, `ItemWriter`s: files & XML/JSON, `ItemWriter`s: databases & alternative destinations, and Repeat & retry internals.
Scaling & tuning — Scaling & parallel processing and Profiling & tuning.
Integration, observability & cloud-native batch — Spring Batch Integration, Observability, and Cloud-native batch.
Testing — Testing batch jobs.