Search code examples
quartz

How to schedule jobs using Quartz at irregular time and dates say at 8:10 am on 22nd May and then again at 6:00 pm on 30th June


I am using Quartz Scheduler to schedule my jobs. I am pretty aware of CronTriggers provided by quartz. But they are useful when their is some repetition pattern (in other words for regular intervals). My question is how can we use quartz for irregular intervals? Say for example I want to schedule a particular job at -- 8:10 am - 22nd May 6:00 pm - 30th June 7:56 am - 5th September

can we do it via CronTriggers. If yes. How?


Solution

  • If there is no pattern, the CronTrigger will not help. You can use a SimpleTrigger per firing date and register all these with the same job.