Baha' Al-Khateib
Baha' Al-Khateib

Reputation: 341

Spring batch list of all chunk items processor

I am working on a project where i am reading items from database A, my chunk size is 2000, in the processor i want to get information from database B, to save time, i want to make one call for the 2000 items only once at reader, but cant do that cuz reader takes one item and returns one item. Is there away to process over list not single item?

Upvotes: 0

Views: 726

Answers (1)

Mahmoud Ben Hassine
Mahmoud Ben Hassine

Reputation: 31710

The item processor processes items one by one. The first callback that gives you a list of items is ItemWriteListener#beforeWrite(List items) in which you can do a single call for all items before writing them.

Upvotes: 1

Related Questions