Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring Batch step without chunk processing

I have a job step that reads from the database and writes the output to a flat file and creates a report.
If the step fails I want it to do the restart, processing all over from the top. I don’t want to incorporate any recovery into this step.
What is the best way to implement Spring Batch so this tasklet doesn’t perform any chunk processing and trigger recovery during the middle of the process?

like image 361
user3557262 Avatar asked Apr 21 '14 16:04

user3557262


1 Answers

Mark job as restartable="true".
Mark step as allow-start-if-complete="true".
Intercept step execution and mark step as COMPLETED also on failure.
When you restart the job your step will be executed from start.

like image 136
Luca Basso Ricci Avatar answered Oct 18 '22 07:10

Luca Basso Ricci