StepExecutionListener - Adding hooks or listeners - Spring Batch Part 8
You can add interceptors to you steps by using the Listeners around your steps. We will check the StepExecutionListener - no points for guessing what it does - in this blogpost. We add add listeners both before and after Steps. Lets consider that along with Corporate Gifts, you also want to supply beautifully arrange chocolates. Lets create a job for it. full code available at: https://github.com/ricsr/spring-batch-demo/tree/exercise_08 @Bean public Job orderChocolateBoxJob (){ return this . jobBuilderFactory .get( "orderChocolateBoxJob" ) .start(selectChocolatesStep()) .next(arrangeChocolatesStep()) .build() ; } @Bean public Step selectChocolatesStep (){ return this . stepBuilderFactory .get( "selectChocolatesStep" ).tasklet( new Tasklet() { @Override public RepeatStatus execute (StepContribution contribution , ChunkContext chunkContext) throws Exception { System. out .println( "Ordering Chocolate : "...