We have several Quartz jobs configured in our application. During development, we leave the quartz scheduler in standby - however, we sometimes want to start a job manually (for development purposes). If I call fireTrigger, it tells me I need to start the scheduler. However, if I start the scheduler, it will also immediately schedule all the other jobs, which is not what I want (since they may trigger while I'm debugging the manually fired job).
I could pause all triggers when I start the scheduler, but then I have to deal with misfire instructions etc.
Is there a simple way to fire off a job manually without having to deal with pausing and misfires (i.e. a fireTrigger which works even if the scheduler is in standby)?
this is the loop you will require to fire the job manually:
No need for
start-time
andend-time
.All the Jobs registered in the Quartz Scheduler are uniquely identified by the JobKey which is composed of a name and group . You can fire the job which has a given JobKey immediately by calling
triggerJob(JobKey jobKey)
of your Scheduler instance.Note:
triggerJob(JobKey jobKey)
.You can try to add a trigger filter in your scheduler
The debug execution filter will add a veto when the execution is not volatile (not scheduled to run immediately) and you are in debug mode .
Here is an implementation example :