1
votes

We are creating a schedule using quartz scheduler by creating a trigger with a trigger name and trigger group which is to be triggered at an interval of 15 minutes.

We would like to trigger the schedule manually at any point of time. So what we have done is we are getting the trigger key details of the job that is associated with the schedule we have created and we are trying to trigger the Job using the following API.

scheduler.triggerJob(scheduler.getTrigger(TriggerKey.triggerKey(triggerName, triggerGroupName)).getJobKey());

But as I use this API and try to trigger the job, I see that in the quartz logs that the job is getting executed with another trigger instead of the trigger which is created and associated with the Job

Please find the logs below:

Quartz Log when job is fired with the API mentioned Above(i.e, trying to fire job manually):

2014:01:07 19:57:34 IST,INFO ,Trigger DEFAULT.MT_2jf0j4717arfk fired job discover.4b7d574a-2827-4ec3-988e-07ef8009e962 at:  19:57:34 01/07/2014
2014:01:07 19:57:34 IST,INFO ,Job [discover.4b7d574a-2827-4ec3-988e-07ef8009e962] to be fired by trigger [DEFAULT.MT_2jf0j4717arfk], re-fire: 0
2014:01:07 19:57:34 IST,INFO ,WxSchedulerJob says: discover.4b7d574a-2827-4ec3-988e-07ef8009e962 executing at Tue Jan 07 19:57:34 IST 2014
2014:01:07 19:57:34 IST,INFO ,Job [discover.4b7d574a-2827-4ec3-988e-07ef8009e962] execution complete and reports: null
2014:01:07 19:57:34 IST,INFO ,Trigger DEFAULT.MT_2jf0j4717arfk completed firing job discover.4b7d574a-2827-4ec3-988e-07ef8009e962 at  19:57:34 01/07/2014

Quartz Log when Job is fired when the Next fire time is reached:

2014:01:07 19:27:41 IST,INFO ,Trigger discover.92ef68a5-b276-473a-9fe7-21b4c4a2461a misfired job discover.19efb015-872d-4017-bbc8-52ae73b70d04  at:  19:27:41 01/07/2014.  Should have fired at:  16:00:00 01/03/2014
2014:01:07 19:27:41 IST,INFO ,Trigger discover.92ef68a5-b276-473a-9fe7-21b4c4a2461a fired job discover.19efb015-872d-4017-bbc8-52ae73b70d04 at:  19:27:41 01/07/2014
2014:01:07 19:27:41 IST,INFO ,Job [discover.19efb015-872d-4017-bbc8-52ae73b70d04] to be fired by trigger [discover.92ef68a5-b276-473a-9fe7-21b4c4a2461a], re-fire: 0
2014:01:07 19:27:41 IST,INFO ,WxSchedulerJob says: discover.19efb015-872d-4017-bbc8-52ae73b70d04 executing at Tue Jan 07 19:27:41 IST 2014
2014:01:07 19:27:41 IST,INFO ,Job [discover.19efb015-872d-4017-bbc8-52ae73b70d04] execution complete and reports: null
2014:01:07 19:27:41 IST,INFO ,Trigger discover.92ef68a5-b276-473a-9fe7-21b4c4a2461a completed firing job discover.19efb015-872d-4017-bbc8-52ae73b70d04 at  19:27:41 01/07/2014

Could anyone please let me know how we can make the schedule is trigger for the job with the original associated trigger.

1

1 Answers

0
votes

I was struggling with the same problem. When you'r trying to trigger this job manually, Quartz creates a default trigger (Trigger DEFAULT.MT_2jf0j4717arfk). Unfortunately, it seems that there is no way to fire scheduled trigger manually.