3

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.

ABandooni
  • 31
  • 1
  • 2

1 Answers1

4

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

Aman J
  • 452
  • 4
  • 15