Search code examples
javaschedulingquartz-scheduler

Quartz trigger start time before current time


Lets say that I have a quartz trigger SimpleTrigger that fires every second and start time is set to 12:00:00 today. It seems that when I schedule that trigger at 12:00:10 then it fires immediately 10 times. Is there a way to avoid that kind of behaviour or should I just manually set start time to 12:00:10 before scheduling?


Solution

  • Set the misfire instruction policy for your particular trigger type. This doc explains what are the available options for the SimpleTrigger http://quartz-scheduler.org/documentation/quartz-2.x/tutorials/tutorial-lesson-05

    By default SimpleTrigger has MISFIRE_INSTRUCTION_SMART_POLICY policy active.