I do not know when you use the quartz is not encountered in such a situation:
Triggers are set to fire every 3 seconds, but the work takes 10 seconds to execute. Therefore, the trigger has missed the trigger before the end of a task execution
How do we deal with this situation, let's study ...
Or do you want to paste the code first:
Job class: Statefuldumbjob.java[Java] View plain copy import java.text.simpledateformat; import java.util.calendar; import org.quartz.disallowconcurrentexecution; import org.quartz.job; import org.quartz.jobdatamap; import org.quartz.jobexecutioncontext; Import org.quartz.JobExecutionException; import org.quartz.persistjobdataafterexecution; @PersistJobDataAfterExecution @DisallowConcurrentExecution Public class StatefulDumbJob implements Job { // static constants, as tasks between calls, keep the Data key (key) // num_executions, the saved count increments by 1 each time // execution_delay, the task in the execution of the middle sleep time. In this case, excessive sleep time leads to missed triggers public static final string num_ executions = "Numexecutions"; public static final String EXECUTION_DELAY = " Executiondelay "; @Override Public void execute (jobexecutioncontext context) throws JobExecutionException { // time of task execution simpledateformat dateformat = new simpledateformat ( "YYYY-MM-DD HH: Mm:ss "); String jobRunTime = Dateformat.format (Calendar.getinstance (). GetTime ()); system.err.println ("---" + context.getjobdetail (). Getkey () getName () + " in : [" + jobruntime + "] carried out!!"); // Task Execution count cumulative jobdatamap map = context.getjobdetail (). Getjobdatamap (); int executeCount = 0; if (Map.containskey (num_executions)) { executeCount = Map.getint (num_executions); } executeCount++; map.put (num_executions, executecount); // sleep time: reset value   by scheduling class; This example is sleep 10s long delay = 5000l; if (Map.containskey (execution_delay)) { delay = map.getlong (execution_delay); } try { Thread.Sleep (delay); } catch (Exception ignore) { }