Recently I noticed that on application start Quartz founds and triggers misfired triggers:
That wasn't not the realistic case in my scenario - since I could see in a database that NEXT_FIRE_TIME is much ahead of the current time.
After digging a little I found the issue in the QuartzScheduledPollConsumerScheduler:
There 2 issues here:
1. Job is rescheduled even if nothing has been changed (i.e. cron expression, cron timezone)
2. existingTrigger.getTriggerBuilder() returns trigger builder with START_TIME of existing trigger which, surely, is the past. This is causing the described bug - NEXT_FIRE_TIME is calculated based on the old START_TIME and is in the past also. So rescheduled trigger becomes misfired trigger immediately.
1. Do not reschedule job if nothing has been changed.
2. If job needs to be rescheduled - make sure to set START_TIME to a current date.