Discussed in #5214
Originally posted by ctrung January 14, 2026
Hi,
With the new concurrency model of Spring Batch 6, ItemReader.read() is accessed by the main thread whereas it was accessed by the threads of the taskExecutor before.
It seems that the reader doesn't need to be thread-safe anymore (I have verified that myself, and the behaviour is the same with or without a thread-safe reader).
Chapter https://docs.spring.io/spring-batch/reference/scalability.html#multithreadedStep of the reference documentation still mentions the need for a thread safe reader.
Are there other usecases where a thread-safe reader is still needed ?
My step definition :
var step = new StepBuilder("my_step", jobRepository)
.<I, O>chunk(5)
.transactionManeger(transactionManager)
.reader(reader)
.writer(writer)
.taskExecutor(taskExecutor)
.build();
Discussed in #5214
Originally posted by ctrung January 14, 2026
Hi,
With the new concurrency model of Spring Batch 6,
ItemReader.read()is accessed by the main thread whereas it was accessed by the threads of the taskExecutor before.It seems that the reader doesn't need to be thread-safe anymore (I have verified that myself, and the behaviour is the same with or without a thread-safe reader).
Chapter https://docs.spring.io/spring-batch/reference/scalability.html#multithreadedStep of the reference documentation still mentions the need for a thread safe reader.
Are there other usecases where a thread-safe reader is still needed ?
My step definition :