0PricingLogin
Spring Boot 4 Microservices & REST APIs · Lesson

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

  1. Scheduling with @Scheduled
  2. Spring Batch Jobs and Steps
  3. Readers, Processors, and Writers
  4. Restart and Error Handling
← Back to Spring Boot 4 Microservices & REST APIs