Replies: 1 comment
-
There is no reliable way to do that. If jobs are terminated abruptly, their status remains So to answer your question: It is not possible to ensure that "running" jobs (or more precisely, abruptly terminated jobs) are restarted on service restart. There is an interesting thread about this here. And you might also check my experiment with abrupt shutdowns here. What do you think? Does that help?
We recently added an API for that: #4876 -- That said, there are some improvements in this area that are planned for v6 (#4431, #4023, #1530). |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
When launching jobs from a web service, the jobs are queued and run in the instance that started them.
However, web services can be restarted at any time, which will stop the processing of those jobs.
How do you ensure that running jobs are restarted when the service is restarted?
I tried this, based on this SO question, which does "work":
There are a number of problems with this hack:
restart
runs its own transaction, which will not see the updates made before it.Is there a better way to ensure jobs continue across service restarts, or anything Spring Batch can add to do this properly?
Beta Was this translation helpful? Give feedback.
All reactions