-
Jul 24th, 2012, 11:09 PM
#1
Stopping Spring batch jobs gracefully
Hi,
What is the best way to stop jobs gracefully ?
JobOperator provides stop(executionId) method but it only sends signal, there is no guarantee that post this statement execution the job has stopped.
To handle this, I am running an infinite loop that will getSummary for the execution-id and in the summary I check for the presence of substring status=BatchStatus.COMPLETED. The loop breaks when status is BatchStatus.COMPLETED
Is it the right approach or there is any better way of managing graceful shutdown of Spring batch jobs ?
Please suggest,
Thanks,
Ranbir
-
Jul 25th, 2012, 01:39 PM
#2
How does Spring Batch Admin handle the situation? Check out its source.
Jeff
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules