Results 1 to 3 of 3

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

  1. #1
    Join Date
    Mar 2009
    Posts
    9

    Default 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. #2
    Join Date
    Jul 2011
    Posts
    16

    Default

    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.

  3. #3

    Default

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •