1
votes

A task is scheduled in the Quartz-scheduler for every hour, starting at 9 AM. Application stops at 10 AM and is restarted at 12 PM. In that case two executions at 10 AM and 11 AM will be missed.

In that case when Scheduler starts again, how many misfires will be considered?

As job was executed at 9AM, it should consider two misfires from 10 AM and 11 AM. If it is so, then how can Quartz identify the last successful schedule as application is already restarted?

1

1 Answers

1
votes

You are asking two questions:

  • How many misfires will be considered?
    As you guessed, two misfires (10 AM and 11 AM) will be detected.
    However, Quartz may or may not consider all of them: depending on the misfire instruction configured in each trigger, Quartz may decide to just consider the last misfire, or ignore them all.

  • How does Quartz store job details between restarts?
    Depending on your configuration, Quartz will store job data in a database via its JDBCJobStore (Java) / AdoJobStore (.NET), or in RAM via its RAMJobStore.
    When using a database store, Quartz will persist all job details to it as they are scheduled, run, finished etc.; and retrieve said details from it upon restart.
    When using a RAM store, job information will not be persisted between Scheduler runs. If the Scheduler gets stopped and then restarted, all jobs will need to be scheduled again; also, no misfires will be detected.

All of this is explained in Quartz's official documentation, I suggest that you take a look around over there for more detailed info.