When you have multiple servers all running the same web application, how would you make sure multiple jobs don't get fired off (the same job)?
Would you have to use the database to monitor if the job was already run?
I've solved this by only letting one of the servers run the scheduled jobs. If that job server goes down I reconfigure another server to start running jobs in its place. In my case the jobs are not all that critical so I can afford this type of "cold standby" solution.
There are however alternatives, Quartz can run with clustered schedulers and job stores. Read more here.
See http://quartz-scheduler.org/documentation/quartz-2.x/configuration/ConfigJDBCJobStoreClustering . It appears that Quartz has a mechanism for this out of the box.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With