Skip to content
stella edited this page Jun 13, 2014 · 12 revisions

Spring Batch + Boot

Spring Batch auto configuration is enabled by adding @EnableBatchProcessing (from Spring Batch) somewhere in your context. By default it executes all Jobs in the application context on startup (see JobLauncherCommandLineRunner for details). You can narrow down to a specific job or jobs by specifying spring.batch.job.names (comma separated job name patterns). If the application context includes a JobRegistry then the jobs in spring.batch.job.names are looked up in the registry instead of being autowired from the context. This is a common pattern with more complex systems where multiple jobs are defined in child contexts and registered centrally. See BatchAutoConfiguration and @EnableBatchProcessing for more details.

Spring Batch 3.0.0 (new feature)

Scaling & Parallel

  • Multi-threaded Step (single process)
  • Parallel Steps (single process)
  • Remote Chunking of Step (multi process)
  • Partitioning a Step (single or multi process)

Multi Threaded step

<step id="loading"> <tasklet task-executor="taskExecutor" throttle-limit="20">...</tasklet></step>

  • Step executes by reading, processing and writing each chunk of items (each commit interval) in a separate thread of execution.
  • there is no fixed order for the items to be processed, and a chunk might contain items that are non-consecutive compared to the single-threaded case.
  • default throttle limit : 4

Clone this wiki locally