2

In Quartz 1.0.x it was possible so set a MisfireInstruction on the trigger by simply setting it:

trigger.MisfireInstruction = MisfireInstruction.CronTrigger.DoNothing;

We upgraded the Quartz version to 2.3.2 and it's not possible to set it like this anymore because trigger.MisfireInstruction has no setter anymore.

How is it possible to set the MisfireInstruction on a trigger now?

I tried to recreate the trigger with a TriggerBuilder like this:

trigger = trigger.GetTriggerBuilder()...

but I couldn't find a MisfireInstruction-Method on the TriggerBuilder too.

Thanks for any help

xeraphim
  • 4,375
  • 9
  • 54
  • 102

1 Answers1

5

This behaviour has changed with version 2, I guess.
MisfireInstruction is now a read-only property and it is set using the builder as you can see in the codebase.

Now you can set the the MisfireInstruction using the TriggerBuilder:

ITrigger myTrigger = TriggerBuilder
    .Create()
    .WithIdentity("trigger1", "myGroup")
    .WithCronSchedule("0 0 12 1/5 * ? *", x => x.WithMisfireHandlingInstructionDoNothing())
    .Build();

You can use a few options:

you can use these options:

  • WithMisfireHandlingInstructionDoNothing
  • WithMisfireHandlingInstructionFireAndProceed
  • WithMisfireHandlingInstructionIgnoreMisfires

A really good article with a good explanation can be found here.

LeftyX
  • 35,328
  • 21
  • 132
  • 193
  • Cool this worked! Thank you :-) I'll upvote you tomorrow since I have no votes left at the moment :) – xeraphim Jul 08 '15 at 09:17
  • 1
    Glad I've helped, xeraphim. A lot of things have changed since version 1.x. If you want to want to find out more about the new features and implementation you can find a lot of good articles on Jay Vilalta's [blog](http://jayvilalta.com/blog/). It's a must to read for quartz.net users. Cheers. – LeftyX Jul 08 '15 at 09:20