Announcement Announcement Module
Collapse
No announcement yet.
Stopping Spring batch jobs gracefully Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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

  • #2
    How does Spring Batch Admin handle the situation? Check out its source.

    Jeff

    Comment

    Working...
    X