In this post under Spring Batch, I will explain how to chain multiple ChunkListener together. For this example I will create two custom ChunkListener interface implementations named ‘CustomChunkListener1’ and ‘CustomChunkListener2’ as shown below CustomChunkListener1 package package35; import org.springframework.batch.core.ChunkListener; import org.springframework.batch.core.scope.context.ChunkContext; public class CustomChunkListener1 implements ChunkListener { @Override public void afterChunk(ChunkContext chunkContext) { System.out.println(“ChunkListener1 processing ended…… Continue reading Chaining multiple ChunkListeners
Tag: ChunkListener
Adding Chunk Level Listeners using ChunkListener
In this post of Spring Batch, I will explain how to add chunk level listeners. In Spring Batch, items are read one at a time, but written to file as a chunk (a collection of records written as one unit). So if total records are 100 and chunk size is 50, they will be two…… Continue reading Adding Chunk Level Listeners using ChunkListener