Transforming items using ItemProcessor

In this post under Spring Batch, I will explain how to achieve Item Transformation using ItemProcessor interface. Item Transformation process transforms the items read by reader before sending them to the writer. The transformation involves changing the state of the read item or creating a completely new object. In the second case, the written item…… Continue reading Transforming items using ItemProcessor

Chaining multiple ItemProcessor

In this post of Spring Batch, I will explain with an example how to chain multiple ItemProcessors. For my example, I will create an ItemProcessor which will go through employee records one item at a time and filter out odd records. Below is the code of the ItemProcessor package package12; import org.springframework.batch.item.ItemProcessor; public class EmployeeFilterItemProcessor…… Continue reading Chaining multiple ItemProcessor

Filtering items using ItemProcessor

In Spring Batch, items are read from the source using reader and written to destination using a writer. Sometimes, we need to add business logic between the reader and writer for the following purpose 1) Filtering an item 2) Converting an item read from one format to another before written to the destination 3) Modify…… Continue reading Filtering items using ItemProcessor