Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

delete trigger in quartz

Tags:

Is there a way to delete a scheduled trigger with a specific job? It seems that only way to delete a trigger is to delete the whole job and then re-register the job and trigger.

I've a job which can potentially have 100+ triggers and I really don't want to delete the job and re-register all the triggers when I just have to delete 1 trigger.

Also, is there a way to stop the scheduler from executing the job as soon as the trigger is configured?

Thanks

like image 732
user140736 Avatar asked Dec 14 '09 22:12

user140736


People also ask

How do I delete a quartz job?

Deleting a Job and Unscheduling All of Its Triggers // Schedule the job with the trigger scheduler. deleteJob(jobKey("job1", "group1"));

How do I Unschedule a quartz job?

We can unschedule a Job by calling the unschedule() method of the Scheduler class and passing the TriggerKey . If the related job does not have any other triggers, and the job is not durable, then the job will also be deleted.

What is trigger in quartz?

Trigger - a component that defines the schedule upon which a given Job will be executed. JobBuilder - used to define/build JobDetail instances, which define instances of Jobs.


1 Answers

try scheduler.unscheduleJob

this accepts the trigger and group names as a parameters and will only remove the trigger specified, not the job.

QuartzScheduler

Scheduler

Forum

like image 104
pstanton Avatar answered Sep 22 '22 15:09

pstanton