2

I am using Quartz 2.2.3 in a springboot application. Every 10 minutes I need to fetch data from a file. So Scheduling the job for every 10 mins, using the below configuration in quartz.properties.

org.quartz.scheduler.skipUpdateCheck=true
org.quartz.threadPool.threadCount=1
org.quartz.jobStore.misfireThreshold=60000
org.quartz.jobStore.class=org.quartz.simpl.RAMJobStore

But I found that the scheduler works only 2 or 3 times, properly. After that it keeps on getting errors "quartz.core.QuartzSchedulerThread - batch acquisition of 0 triggers". Verified thread dump too.

schedulerFactoryBean_QuartzSchedulerThread" #15 prio=5 os_prio=0 tid=0x000000001b6d6800 nid=0x2808 in Object.wait() [0x000000001d88e000] java.lang.Thread.State: TIMED_WAITING (on object monitor)

schedulerFactoryBean_Worker-1" #14 prio=5 os_prio=0 tid=0x000000001b056800 nid=0x4bcc in Object.wait() [0x000000001bbbf000] java.lang.Thread.State: TIMED_WAITING (on object monitor)

I Added a TriggerListener and a JobListener and found that after the 3rd sample the trigger is not fired.

What might be the problem?

mbuechmann
  • 5,413
  • 5
  • 27
  • 40
Shobana
  • 41
  • 4
  • Can you please share the trigger type and its configuration? Maybe the job is not getting fired because it is a non-concurrent job and it is still executing at the time when the job should be fired for the 4th time. Maybe the trigger has an end time that prevents future executions. Maybe you use a Quartz calendar that's associated with your trigger and it excludes some time periods. There are several possible reasons. I recommend that you get a trial license of QuartzDesk [a product that I started] and use it to inspect your job+trigger configs and the contents of your Quartz job store. – Jan Moravec Dec 18 '18 at 20:18
  • Actually i used the cron expression as "0 0/15 18 * * ?". So starts at 6:00 PM and runs at 6:15,6:30,6:45 successfully. But it is not triggered at 7:00 PM as this cron expression consider only the hour 18(6 PM).So with in the hour 18, runs every 15 min successfully, when it comes to 19 (7 PM) it does not triggered. – Shobana Dec 19 '18 at 09:31
  • Please suggest the cron expression to start the scheduler at 6.15 PM, runs every 15 mins continuously. When give the expression as "0 15/15 18/1 * * ?" . Starts at 6:15 PM and runs at 6:30,6:45 and next scheduled for 7:15. I am expecting continuous running. – Shobana Dec 19 '18 at 09:33
  • "0 0/15 18 * * ?" fires at 18:00, 18:15, 18:30 and 18:45. Since the hour field does not cover 19, the trigger will not fire at 19:xx. – Jan Moravec Dec 19 '18 at 13:39
  • "0 15/15 18/1 * * ?" fires the job as you indicated. See this screenshot showing calculated fire times: https://ibb.co/zmbcTsB – Jan Moravec Dec 19 '18 at 13:42
  • If you want cron trigger to start firing at 18:00 and then every 15 minutes, then you simply set the trigger start fire time to 18:00:00 and set the cron expression to "0 0/15 * * * ?". See this screenshot: https://ibb.co/njW0vp5 – Jan Moravec Dec 19 '18 at 13:46
  • Hi Jan thanks a lot. In the attachment executed with the expression "0 15/15 18/1 * * ?", i could see 6.15,6.30,6.45 ... after that 7.00 is missing. directly scheduled for 7.15. This is the issue with this expression. But the final one shows proper values. I can use the expression "0 0/15 * * * ?". But need to check the java code to have start fire time set to 6.00 PM – Shobana Dec 20 '18 at 05:45

0 Answers0