Manya
Manya

Reputation: 11

How to prevent Quartz scheduler from missing few executions

We have quartz scheduler to trigger the jenkins job which will be created on the fly through Jenkins create API. So I have placed my create jenkins job API call inside the execute internal method.When multiple parallel requests are made, sometimes all the requests are picked up for execution and sometimes few are missed. The count of missed executions differs. How do I make this stop and make quartz to run all of my requests.

Tried increasing the thread count and misfire threshold but the issue exists

Upvotes: 0

Views: 436

Answers (1)

asolanki
asolanki

Reputation: 1373

Seems like all you need is to set the correct misfire instruction based on your business logic and type of trigger

Trigger trigger = TriggerBuilder.newTrigger() .
    withIdentity(changePoolNameTriggerKey).
    startAt(new DateTime().plusSeconds(configuration.getInt(JobConstants.execution_latency)).
    toDate().
    build(); 


((MutableTrigger) trigger).setMisfireInstruction(MISFIRE_INSTRUCTION_FIRE_NOW)

Upvotes: 0

Related Questions