Skip to main content

Spring Batch

General Concepts

  • In your code, you define a Job. That job gets created with a JobBuilderFactory.
  • A Job has one or more Steps. Each step is created with a StepBuilderFactory.
  • A Step could be either:
    • A Tasklet, which executes some arbitrary code
    • A series of chunked steps, each of which has an ItemReader, ItemProcessor, and ItemWriter.

Tasklets versus Chunked

Baeldung Article On The Subject

A general rule for which to pick could be covered as:

  • If you need to process a single item, use a Tasklet
  • If you need to process multiple items iteratively, use a Chunked approach