Can I write a Spring Batch step with a single ItemReader and multiple substeps, each with an ItemProcessor followed by a ItemWriter?
I am trying to achieve something like this:
ItemReader ---> item ---> ItemProcessor#1 ---> ItemProcessor#2
| |
v v
ItemWriter#1 ItemWriter#2
Additional notes
- To avoid inconsistencies, I would prefer not to read items twice.
- The second
ItemProcessor
will need to filter out some items, which should be written by the firstItemWriter
, but not by the second one.
I believe this question to be a different question from Spring Batch: One reader, multiple processors and writers because I would need to process items sequentially, and not in parallel.