7

我将带有 Spring 的 Quartz 调度程序作为我的应用程序的一部分,它部署在集群环境中。问题是 Quartz 不断触发大量查询(每分钟数百次),即使我的作业计划每小时运行一次(作业被正确触发)。有没有办法避免/延迟这些 Quartz 查询?

编辑:添加一些 Quartz 触发的查询

UPDATE QRTZ_TRIGGERS SET TRIGGER_STATE = 'ACQUIRED' WHERE SCHED_NAME = 'SW_QUARTZ_SCHEDULER' AND TRIGGER_NAME = 'createCronTriggerFactoryBeanForPSDJob' AND TRIGGER_GROUP = 'SPRING3-QUARTZ' AND TRIGGER_STATE = 'WAITING'

INSERT INTO QRTZ_FIRED_TRIGGERS (SCHED_NAME, ENTRY_ID, TRIGGER_NAME, TRIGGER_GROUP, INSTANCE_NAME, FIRED_TIME, STATE, JOB_NAME, JOB_GROUP, IS_NONCONCURRENT, REQUESTS_RECOVERY, PRIORITY) VALUES('SW_QUARTZ_SCHEDULER', 'sw-jayz-5413692078375651369207837517', 'createCronTriggerFactoryBeanForPSDJob', 'SPRING3-QUARTZ', 'sw-jayz-541369207837565', 1369207800000, 'ACQUIRED', NULL, NULL, 0, 0, 0)

SELECT * FROM QRTZ_JOB_DETAILS WHERE SCHED_NAME = 'SW_QUARTZ_SCHEDULER' AND JOB_NAME = 'createJobDetailFactoryBeanForPSDJob' AND JOB_GROUP = 'SPRING3-QUARTZ
DELETE FROM QRTZ_SIMPLE_TRIGGERS WHERE SCHED_NAME = 'SW_QUARTZ_SCHEDULER' AND TRIGGER_NAME = 'createCronTriggerFactoryBeanForQMRJob' AND TRIGGER_GROUP = 'SPRING3-QUARTZ'
4

1 回答 1

4

我认为您正在寻找org.quartz.scheduler.idleWaitTime,默认情况下每 30 秒访问一次数据库以查找新的查询,当计划没有更好的事情可做时。(文档链接

于 2013-05-31T03:47:25.690 回答