Quartz Scheduler: how to run a job in only one machine?

隐身守侯 提交于 2019-12-24 08:13:32

问题


I'm trying to setup quartz to execute in 2 machines (sharing the same database). How to setup quartz to run a job (or a set of jobs) in just one machine (another machine cannot pick the job)?


回答1:


Can you elaborate your question a bit.

1) If you want both the machines to share the load but want only one instance of the batch to be run at any given time, then you can annotate your job with @DisallowConcurrentExecution

2) or if you always want only one machine to handle all the load, then why are you using clustered mode? If you are trying to achieve active-stand by model, then you want the machines to co-ordinate outside of quartz which could get tricky.



来源:https://stackoverflow.com/questions/41470884/quartz-scheduler-how-to-run-a-job-in-only-one-machine

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!