From the course: Spring: Spring Batch
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.