How to add a cron trigger with or condition?

655 Views Asked by At

My condition is like that, i want a trigger to be fired every month on the date say 30, but the month February dosn't have this particular date ,so during execution will the quartz through a exception or it will execute that trigger on the day 28 for February.if it throws a exception then what will be the solution.

thnx.

1

There are 1 best solutions below

0
On

Try with this.

trigger = newTrigger() .withIdentity("trigger3", "group1") .startNow() .withSchedule(cronSchedule("0 0 15 L * ?")) .build();

// fire on the last day of every month at 15:00

Reffer this link

http://quartz-scheduler.org/documentation/quartz-2.x/cookbook/MonthlyTrigger