Reputation: 499
jobOperator.restart(JobExecutionId)
starts a new job instance and don't resume job from the last chunk but just from last step. I need to resume the job from the last chunk written.
My reader is a custom RestReader that count first the total of items to process and then read this exact number from api. I'm using @StepScope annotation because I need custom variables in custom reader
Spring Batch restart functionality not working when using @StepScope.
Is it possible to resume the job from last chunk written or the problem is my custom reader?
Upvotes: 0
Views: 883
Reputation: 31600
Your RestReader
must implement ItemStream. This is the contract that stateful item readers should implement. The ItemStream#update
method will be called at chunk boundaries to save any contextual data required to restart from the last checkpoint in case of failure.
Upvotes: 0