我正在尝试将Quartz Scheduler集成到我们的Spring应用程序中,具有10个作业,每个作业执行3分钟(Thread.sleep(3Min)),每个作业在每小时的第59分钟运行,如下cron表达式所示。
0 0/59 * * *?
注意:不使用任何群集,而是将JDBC存储作为MySQL使用,仅在一台计算机上运行。
要解释以下输出,
输出如下:
INFO: Server startup in 55196 ms
ENTERED: Job Execution for the JOb Name: BSQJ-1 at the time of 2019/02/08 08:59:00
ENTERED: Job Execution for the JOb Name: BSQJ-2 at the time of 2019/02/08 08:59:01
ENTERED: Job Execution for the JOb Name: BSQJ-3 at the time of 2019/02/08 08:59:03
Feb 08, 2019 9:00:02 AM org.quartz.impl.jdbcjobstore.JobStoreSupport recoverMisfiredJobs
INFO: Handling 7 trigger(s) that missed their scheduled fire-time.
Feb 08, 2019 9:01:02 AM org.quartz.impl.jdbcjobstore.JobStoreSupport recoverMisfiredJobs
INFO: Handling 3 trigger(s) that missed their scheduled fire-time.
EXITING: the Job Execution for the Job Name: BSQJ-1 at the time of 2019/02/08 09:02:00
EXITING: the Job Execution for the Job Name: BSQJ-2 at the time of 2019/02/08 09:02:01
ENTERED: Job Execution for the JOb Name: BSQJ-1 at the time of 2019/02/08 09:02:02
Feb 08, 2019 9:02:03 AM org.quartz.impl.jdbcjobstore.JobStoreSupport recoverMisfiredJobs
INFO: Handling 7 trigger(s) that missed their scheduled fire-time.
EXITING: the Job Execution for the Job Name: BSQJ-3 at the time of 2019/02/08 09:02:03
ENTERED: Job Execution for the JOb Name: BSQJ-2 at the time of 2019/02/08 09:02:09
ENTERED: Job Execution for the JOb Name: BSQJ-4 at the time of 2019/02/08 09:02:11
Feb 08, 2019 9:03:02 AM org.quartz.impl.jdbcjobstore.JobStoreSupport recoverMisfiredJobs
INFO: Handling 1 trigger(s) that missed their scheduled fire-time.
Feb 08, 2019 9:04:03 AM org.quartz.impl.jdbcjobstore.JobStoreSupport recoverMisfiredJobs
INFO: Handling 6 trigger(s) that missed their scheduled fire-time.
EXITING: the Job Execution for the Job Name: BSQJ-1 at the time of 2019/02/08 09:05:02
Feb 08, 2019 9:05:02 AM org.quartz.impl.jdbcjobstore.JobStoreSupport recoverMisfiredJobs
INFO: Handling 1 trigger(s) that missed their scheduled fire-time.
ENTERED: Job Execution for the JOb Name: BSQJ-5 at the time of 2019/02/08 09:05:04
EXITING: the Job Execution for the Job Name: BSQJ-2 at the time of 2019/02/08 09:05:09
EXITING: the Job Execution for the Job Name: BSQJ-4 at the time of 2019/02/08 09:05:11
ENTERED: Job Execution for the JOb Name: BSQJ-3 at the time of 2019/02/08 09:05:11
Feb 08, 2019 9:06:02 AM org.quartz.impl.jdbcjobstore.JobStoreSupport recoverMisfiredJobs
INFO: Handling 5 trigger(s) that missed their scheduled fire-time.
ENTERED: Job Execution for the JOb Name: BSQJ-6 at the time of 2019/02/08 09:06:08
Feb 08, 2019 9:08:02 AM org.quartz.impl.jdbcjobstore.JobStoreSupport recoverMisfiredJobs
INFO: Handling 4 trigger(s) that missed their scheduled fire-time.
EXITING: the Job Execution for the Job Name: BSQJ-5 at the time of 2019/02/08 09:08:04
ENTERED: Job Execution for the JOb Name: BSQJ-7 at the time of 2019/02/08 09:08:07
EXITING: the Job Execution for the Job Name: BSQJ-3 at the time of 2019/02/08 09:08:11
ENTERED: Job Execution for the JOb Name: BSQJ-8 at the time of 2019/02/08 09:08:13
EXITING: the Job Execution for the Job Name: BSQJ-6 at the time of 2019/02/08 09:09:08
Feb 08, 2019 9:10:03 AM org.quartz.impl.jdbcjobstore.JobStoreSupport recoverMisfiredJobs
INFO: Handling 2 trigger(s) that missed their scheduled fire-time.
ENTERED: Job Execution for the JOb Name: BSQJ-9 at the time of 2019/02/08 09:10:07
EXITING: the Job Execution for the Job Name: BSQJ-7 at the time of 2019/02/08 09:11:07
EXITING: the Job Execution for the Job Name: BSQJ-8 at the time of 2019/02/08 09:11:13
Feb 08, 2019 9:12:02 AM org.quartz.impl.jdbcjobstore.JobStoreSupport recoverMisfiredJobs
INFO: Handling 1 trigger(s) that missed their scheduled fire-time.
ENTERED: Job Execution for the JOb Name: BSQJ-10 at the time of 2019/02/08 09:12:05
EXITING: the Job Execution for the Job Name: BSQJ-9 at the time of 2019/02/08 09:13:07
EXITING: the Job Execution for the Job Name: BSQJ-10 at the time of 2019/02/08 09:15:05
从上到下的问题如下:
如上所述,在第二点中,当我计算出执行总数为10个作业中的13个时,这意味着3个作业被重新执行。 这让我感到困惑,并想知道我是否犯了任何错误。
如果Quartz Scheduler的行为方式如此,那么我需要更改设计以维持工作的独立状态,无论是否完成。如果未完成,则在该时间实例中针对同一作业再次进行计算。
在此先感谢并感谢您的见解。