You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I propose implementing the TriggerListener for the QuartzAdaptor. In the methods we can log info like when the trigger will fire again on trigger fire
e.g.
@Override
public void triggerFired(Trigger trigger, JobExecutionContext context) {
LogEvent evt = getLog().createInfo();
evt.addMessage(getName() + " Trigger Fired and it will fire again at " + trigger.getNextFireTime() + " "
+ context.getJobDetail());
Logger.log(evt);
}
@Override
public boolean vetoJobExecution(Trigger trigger, JobExecutionContext context) {
return false;
}
@Override
public void triggerMisfired(Trigger trigger) {
LogEvent evt = getLog().createInfo();
evt.addMessage(getName() + " Trigger MIS-Fired and will fire again at " + trigger.getNextFireTime());
Logger.log(evt);
}
I also propose adding a a misfire instruction when the trigger is created. At times the trigger does not fire and we have no clue what happened. The above trigger listener will help with logging the misfire.
Based on the default config of "org.quartz.jobStore.misfireThreshold", "60000", if the trigger is not fired in one minutes time it will be treated as a misfire and the instruction withMisfireHandlingInstructionFireAndProceed it will fire the trigger.
This may not suit everyone but can be made configurable to select what to do on a misfire.
e.g.
I will make a pull request (next week). Its something I did recently so its been locally tested by me. The problem I usually face is with the code formatting. My custom eclipse code formatters will end up making showing a lot more changes, I will try my best to comply with the existing format.
There is one more change that would be nice. Jpos has the QuartzJobSupport , I added a new one called QuartzStatefulJobSupport. They are identical, except the stateful one has class level annotations: @PersistJobDataAfterExecution
@DisallowConcurrentExecution
So if an existing job is running, a concurrent one wont be started. Helps to extend your job which runs often and dont want multiple jobs running together.
I propose implementing the TriggerListener for the QuartzAdaptor. In the methods we can log info like when the trigger will fire again on trigger fire
e.g.
I also propose adding a a misfire instruction when the trigger is created. At times the trigger does not fire and we have no clue what happened. The above trigger listener will help with logging the misfire.
Based on the default config of "org.quartz.jobStore.misfireThreshold", "60000", if the trigger is not fired in one minutes time it will be treated as a misfire and the instruction withMisfireHandlingInstructionFireAndProceed it will fire the trigger.
This may not suit everyone but can be made configurable to select what to do on a misfire.
e.g.
The text was updated successfully, but these errors were encountered: