Readers, Processors, and Writers
Build the chunk-oriented batch flow.
The read-process-write triad
A chunk step has three collaborators:
- ItemReader - supplies items one at a time
- ItemProcessor - transforms or filters an item
- ItemWriter - persists a chunk of items
ItemReader interface
ItemReader.read() returns the next item, or null when the input is exhausted. Spring Batch keeps calling it until it returns null.
public interface ItemReader<T> {
T read() throws Exception;
}All lessons in this course
- Scheduling with @Scheduled
- Spring Batch Jobs and Steps
- Readers, Processors, and Writers
- Restart and Error Handling