Spring Batch

Category: /blog /programmer
Tags: programmer


What is Spring Batch?

Batch processing requirements:

  • Large data volume
  • Automation
  • Robustness
  • Reliablity
  • Performance

Spring Batch is an open source batch-oriented framework dealing with most common needs of batch applications.

What is it good for? Main features:

  • Spring Framework foundations: reuse dependency injection, AOP
  • batch-oriented processing: good for data reading/writing
  • ready-to-use components: I/O for databases and files
  • Robustness and reliability: able to define skip/retry etc


job execution monitor/restart on failure

Chunk Processing

Spring Batch handles read-write scenarios using ItemReader and ItemWriter. ItemProcessor is used to handle transformation before send it to ItemWriter.


Reading a flat file: FlatFileItemReader (e.g. read CSV file)

DefaultLineMapper: delegates line reading

LineTokenizer to split a line into fields.

fieldSetMapper to transform the split line into a domain object.




  • 如果看不到讨论部分, 请暂时关掉adblock in Firefox/Chrome
  • 本网站使用Javascript实现评论功能, 此处外链对提高您的网站PR没有帮助. (潜台词: 请不要灌水, 谢谢)