I have the Quartz scheduler with Spring as part of my application, which is deployed in a clustered environment. The problem is that Quartz keeps firing a lot of queries (hundreds per minute) even though my jobs are scheduled to run once per hour (the jobs are triggered correctly). Is there a way to avoid/delay these Quartz queries?
EDIT: adding some queries fired by 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'
deleteJob(jobKey(<JobKey>, <JobGroup>)); This method will only interrupt/stop the job uniquely identified by the Job Key and Group within the scheduler which may have many other jobs running. scheduler. shutdown();
The actual number of jobs that can be running at any moment in time is limited by the size of the thread pool. If there are five threads in the pool, no more than five jobs can run at a time.
Pause the JobDetail with the given name - by pausing all of its current Trigger s. Pause all of the JobDetail s in the matching groups - by pausing all of their Trigger s. Pause the Trigger with the given name.
To shutdown / destroy a scheduler, simply call one of the shutdown(..) methods. Once you have shutdown a scheduler, it cannot be restarted (as threads and other resources are permanently destroyed). Also see the suspend method if you wish to simply pause the scheduler for a while.
I think you're looking for org.quartz.scheduler.idleWaitTime
, which defaults to hitting the database every 30 seconds to look for new queries when the schedule has nothing better to do. (Documentation link)
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