Reputation: 43
Bonjour,
I need to stop a running spring batch with Failure status if, in my reader, a test return true. How can I do this ? I actually use System.exit(-1), but I think that spring batch has his own way to stop running batch with different status.
here is the function in my reader from which I want to stop the batch:
private List<Test> getListTest() throws Exception {
...
if (stop) {
logger.error("Stop running batch");
System.exit(-1);
return null;
}
...
}
Merci et bonne journée
Upvotes: 1
Views: 3180
Reputation: 494
There are two ways to fail a spring batch job.
Upvotes: 2