From the course: Spring: Spring Batch

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Multi-threaded steps

Multi-threaded steps

- [Instructor] Most batch jobs can be executed using a single thread. However, when performance issues arise, you may need to consider building a multi-threaded job that performs processing over multiple threads. Switching to a multi-threaded job should not be taken likely because it comes with trade-offs. Multi-threaded jobs inherently lose the capability to restart. So let's assume we did our due diligence and determined that multi-threading is required. Let's take a look at how it's put in place. I've added a couple things within the working files for this lesson to help us be successful. So the first thing that I've added is within our TrackedOrderItemProcessor. I am now outputting the thread that is being used by this processor and that's going to help us keep track of the multi-threaded nature of the job. Now the other thing that we needed to put in place was a different item writer. The item writer that we were…

Contents