Reputation: 4386
I'm using spring batch and I want to write a job where I have a JPA reader that selects paginated sets of products from the database. Then I have a processor that will perform some operation on every single product (let's say on product A
), but performing this operation on product A
the item processor will also process some other products too (like product B
, product C
, etc.). Then the processor will come to product B
because it's in line and is given by the reader. But it has already been processed, so it's actually a waste of time/resources to process it again. How should one actually tackle this - is there a modification aware item reader in spring batch? One solution would be in the item processor to check if the product has already been processed, and only if it hasn't been then process it. However checking if the product has been process is actually very resource consuming.
Upvotes: 0
Views: 241
Reputation: 21463
There are two approaches here that I'd consider:
Upvotes: 2