Results 1 to 2 of 2

Thread: Stopping Spring batch jobs gracefully

  1. #1
    Join Date
    Aug 2011
    Posts
    6

    Default 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. #2

    Default

    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
  •