All that you mentioned is possible in the Quartz scheduler, and there is already a function with triggers, which we usually call Misfire Instructions
, this is what doc is talking about.
Another important property of a trigger is its “misfire instruction”. Skipping gaps occur if a constant trigger “misses” the response time due to the scheduler stopping or due to the lack of available threads in the Quartz thread pool to complete the task. Different types of triggers have different skipping instructions. By default, they use the smart policy command, which has dynamic behavior based on the type and configuration of the trigger. When the scheduler starts, it searches for any persistent triggers that are missed, and then updates each of them based on their individually configured skip instructions. When you start using Quartz in your own projects, you should familiarize yourself with the skip instructions that are defined in these types of triggers and explained in their JavaDoc. More information about skipping instructions will be provided in the lessons of the lessons specific to each type of trigger.
In terms of job preservation, Quartz comes with a small build mechanism and all you need to install JobStore as JDBCJobStore
I suggest you go with the Quartz scheduler document its pretty easy and have lots of tutorials and examples to get you started.
If you are not using Spring in your application, there is no need to add an extra layer of abstraction and dependencies.
source share