0
votes

I am implementing Quartz scheduler with JDBC JobStore in Spring. I have a use case, where if my application crashes and it has jobs to be executed within time frame between the crash and restart of the scheduler. My approach is to compare nextExecutionTime for all jobs with the current time at startup of the scheduler and if the nextExecutionTime is less than the current time, execute the job.


But I have a strong notion that there is a nicer way to get this job done. Either supported by Quartz or already implemented by someone. Can you suggest a better approach for this?

1

1 Answers

1
votes

Does the misfire instruction feature do what you want? See the tutorial at Quartz Tutorial Lesson 4 and more specifically Example - Job Misfires You probably need to call withMisfireHandlingInstructionFireNow() when you build your trigger.