I wrote a spring batch job that processes List of Lists.
Reader returns List of List. Processor works on each ListItem and returns processed List. Writer writes stu
I did read about AsyncItemProcessor and AsyncItemWriter, but I am not sure if that is something I should use in this scenario.
Yes, AsyncItemProcessor
and AsyncItemWriter
are suitable for your use case. The AsyncItemProcessor
will execute the logic (your rest call) of the delegate ItemProcessor
for an item on a new thread. Once the item completes, the Future
of the result is passed to the AsynchItemWriter
to be written. The AsynchItemWriter
will then unwrap the Future
and write the item. The advantage of these components is that you don't have to deal with Future
s wrapping, unwrapping, etc yourself.
You can find:
Hope this helps.