Announcement Announcement Module
Collapse
No announcement yet.
How do you shutdown spring batch and allow an application to exit? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How do you shutdown spring batch and allow an application to exit?

    My application is going to be called by a CRON job to do some background processing and I am using Spring Batch to wire up what processing needs to be done. I found that even after all my jobs are run, my application does not exit. I need to do a System.exit(0) to force the application to stop. This doesn't seem right. How can I shutdown spring batch when I'm done with it so my application can exit?

  • #2
    It probably is not a spring batch issue at all. It sounds more like you have non-deamon Threads running even after your main thread has finished executing.

    Comment


    • #3
      Where does your 'main' live - is this Spring Batch in a web app, or standalone? If it's standalone, did you write the 'main' method yourself?

      If you have a simple job launcher, it's just going to run that job and complete. At that point, if that's all your 'main' does, it should exit.

      Last but not least, you can take a look at the Spring Batch Admin, it provides hooks to start/pause/stop jobs, which I've found very useful.

      Comment

      Working...
      X