O'Reilly logo

Mastering Spring Application Development by Anjana Mankale

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Intercepting a Spring Batch job with listeners

Spring Batch comes with listeners. They intercept the job execution to perform certain tasks. StepListener is a super class for the following mentioned listeners:

  • SkipListener: One of the most common use cases for SkipListener is to log out a skipped item so that another batch process, or even human process, can be used to evaluate and fix the issue leading to the skip. Because there are many cases in which the original transaction may be rolled back, Spring Batch makes two guarantees:
    • The appropriate skip method (depending on when the error happened) will only be called once per item.
    • The SkipListener will always be called just before the transaction is committed. This is to ensure that any transactional ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required