From the course: Spring: Spring Batch

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Chaining ItemProcessors

Chaining ItemProcessors

From the course: Spring: Spring Batch

Start my 1-month free trial

Chaining ItemProcessors

- [Speaker] Spring Batch allows item processors to be chained so that multiple processors can be included within a step. This is important when multiple pieces of processing logic must execute within a chunk based step. Let's take a look at how we can include, both, our bean validating item processor and our tracked order item processor, within the configuration of our step. We're going to start by navigating to our chunk based step, and we're going to modify its configuration. Currently, it's using a single item processor, the tracked order item processor. We're going to go ahead and remove that, and we're going to replace it with a composite item processor method call. And this call is going to return a new composite item processor bean. So let's go ahead, we'll hit control + 1. We'll create that method and then we're going to copy it and move it to the top of our class. And from there we'll get to work on building…

Contents