[devnexus 2022] batch processing in action

Speaker: Hillmer Chona & Rodrigo Graciano

Twitter @HillmerCh and @RodgrigoGraciano

Link to table of contents


Anotations vs XML

  • @EnableBatchProcessing automatically provides beans for job repo, job launcher, etc
  • If use XML, need to create all beans yourself
  • Don’t mix and match XML vs annotations. Could wind up with two of a bean


  • Steps – one reader/writer
  • Job repository – provided by framework
  • async doesnt block – JobLauncher vs AsyncJobLauncher
  • Can run at the comand line or in web container
  • Processors – transform, filter, validate
  • Chunk – collect data and sent data on when chunk complete
  • Many types of readers, and writers built in. Can also write own
  • Listeners run before/after job
  • Step listeners are more detailed
  • Fault tolerance – skip exceptions
  • Retries


  • Conditional – exit status, run different step on success/fail.
  • Decider – can have custom logic, not just exit status ex: day of week)
  • Split – run steps in paralelel

Live demo

  • Heavy use of chaining
  • Yay! Records
  • JobExecutionListener has two methdods beforeJob() and afterJob(). Alternatively, an put logic in parent job

My take

The keynote ran late and I didn’t make it in tie for the beginning. Luckily, I saw Rodrigo do a practice run so was able to jump in. Lots of information and presentation well designed for explaining concepts

Leave a Reply

Your email address will not be published. Required fields are marked *