Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Triggers misfire in Quartz scheduler

Is there any way by which we can resume triggers in Quartz once system is back online?

We have some scheduled trigger(with frequency interval 6 hours), Sometime our system went down and it skips the execution of those triggers.

Can anyone suggest if its possible using Quartz scheduler to resume trigger those missed during downtime.

like image 251
ABandooni Avatar asked Dec 20 '25 03:12

ABandooni


1 Answers

You should include "MISFIRE_INSTRUCTION" with your trigger, while defining it. The below example shows MISFIRE_INSTRUCTION_FIRE_NOW

Trigger trigger = newTrigger().
    startAt(DateUtils.addSeconds(new Date(), -10)).
    withSchedule(
        simpleSchedule().
            withMisfireHandlingInstructionFireNow()  //MISFIRE_INSTRUCTION_FIRE_NOW
        ).
    build();

For a detailed explanation : see this

like image 87
Aman J Avatar answered Dec 22 '25 18:12

Aman J



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!