We use a TaskExecutor in our step and use StepScope reader, processor and writer. We set page size to 15000, chunk size to 50, and thread count to 20.
Firstly, does each thread get its own instance of StepScope reader, processor and writer or there is only instance of reader,processor,writer per step and shared across all threads?
Also, is the following correct?
Thanks.
Firstly, does each thread get its own instance of StepScope reader, processor and writer or there is only instance of reader,processor,writer per step and shared across all threads?
Step-scoped beans are not shared, each step will have its own instance of the bean.
Also, is the following correct?
No, in a multi-threaded step, each chunk is processed by a separate thread from the task executor. Therefore, the order of items reading and processing is undefined (compared to a sequential execution).
Please refer to the Multi-threaded Step section for more details.