Springboot Qaurtz Scheduler skips the next fire time

52
June 23, 2022, at 06:00 AM

I am using Quartz Scheduler to schedule some Jobs, when I was using a simple trigger for hourly and daily intervals it was working fine.

For Monthly and Yearly schedules I moved to Cron Scheduler, it always skips the next fire time If I schedule for Feb 10, but it starts from Mar 10 if I use to run every 2 months it starts on April 10

I tried

0 0 0 10 JAN-DEC/2 ?

Also with

0 0 0 10 */2 ?

Code I use to create the Job trigger

  trigger.withSchedule(cronSchedule(cornExpression)
      .inTimeZone(TimeZone.getDefault())
      .withMisfireHandlingInstructionDoNothing()).startAt(schedulerOptions.getStartsAt());

Value of schedulerOptions.getStartsAt()

Thu Feb 10 20:00:00 IST 2022

the trigger is TriggerBuilder

Here are the Debugger Values of the Trigger Object

After creating the Trigger, I checked for the next fire time, it skipped the next month, below is the debug value of the nextfiretime

READ ALSO
Why I am unable to wrap the execution of a request with an @Around advice?

Why I am unable to wrap the execution of a request with an @Around advice?

I work on a REST API, and I'd like to do some very simplistic tests to see how long it takes to process a request

40
removeRow using XSSF libraries is not working

removeRow using XSSF libraries is not working

I tried the below code, but it's not working

71
WatchService watching files on distributed filesystem from multiple machines

WatchService watching files on distributed filesystem from multiple machines

I am trying to implement a WatchService that watches a filesystem for changesOnce files get created I want to create tasks for each new file and add that task to a distributed queue to let it get processed from multiple machines

36