简体   繁体   English

Quartz Scheduler中的多个作业未根据触发器运行

[英]Multiple Jobs in Quartz Scheduler not running according to the triggers

I have configured a quartz scheduler with 4 different jobs, each triggering every 1 minute. 我为石英调度程序配置了4个不同的作业,每个作业每1分钟触发一次。 The schedule I have configured is as follows:- 我配置的时间表如下:-

  <schedule> <job> <name>LockMonitor</name> <job-class>background.jobs.LockMonitor</job-class> </job> <trigger> <simple> <name>LockJobTrigger</name> <job-name>LockMonitor</job-name> <repeat-count>-1</repeat-count> <repeat-interval>60000</repeat-interval> </simple> </trigger> <job> <name>LogMonitor</name> <job-class>background.jobs.LogMonitorJob</job-class> </job> <trigger> <simple> <name>LogMonitorTrigger</name> <job-name>LogMonitor</job-name> <repeat-count>-1</repeat-count> <repeat-interval>60000</repeat-interval> </simple> </trigger> <job> <name>ProcessMonitor</name> <job-class>background.jobs.ProcessMonitor</job-class> </job> <trigger> <simple> <name>ProcessMonitorTrigger</name> <job-name>ProcessMonitor</job-name> <repeat-count>-1</repeat-count> <repeat-interval>60000</repeat-interval> </simple> </trigger> <job> <name>HealthCheck</name> <job-class>background.jobs.HealthCheck</job-class> </job> <trigger> <simple> <name>HealthCheckTrigger</name> <job-name>HealthCheck</job-name> <repeat-count>-1</repeat-count> <repeat-interval>60000</repeat-interval> </simple> </trigger> </schedule> 

The problem that I am encountering is that only the 1st and 2nd jobs are getting executed most of the time. 我遇到的问题是,大多数情况下只有第一个和第二个作业得到执行。 The 3rd and 4th jobs - namely ProcessMonitor and HealthCheck are getting executed only once in a while. 第三和第四作业-即ProcessMonitor和HealthCheck仅偶尔执行一次。 Can someone help me with this? 有人可以帮我弄这个吗? Is this because I have configured the same time interval for all the jobs? 这是因为我为所有作业配置了相同的时间间隔吗? Is there any means by which I can ensure that all the 4 jobs are executed before starting the next set of execution? 有什么方法可以确保在开始下一组执行之前所有这4个作业都已执行?

I have configured all the jobs as implements StatefulJob 我已将所有作业配置为实现StatefulJob

How many threads did you configure? 您配置了多少个线程? When I keep the number of thread == number of jobs registered to run in the Quartz framework, everything seems to run as expected. 当我保持线程数==注册在Quartz框架中运行的作业数时,一切似乎都按预期运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM