user3557262
user3557262

Reputation: 61

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?

Upvotes: 6

Views: 1873

Answers (1)

Luca Basso Ricci
Luca Basso Ricci

Reputation: 18403

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.

Upvotes: 2

Related Questions