How can I handle the "exceptions" caused by a job run by Quartz scheduler so that it is run on the following scheduled time. I don't want it to refireImmediately or I don't want it to drop this job. Just keep it in the jobstore until its next turn.
If you throw an exception from a Job
and it is not JobExecutionException
with refireImmediately
set, this execution will be discarded and proceed with normal schedule. E.g. when a job is suppose to run every 10 seconds and a single execution threw an exception, Quartz will simply discard this exceution and run next one after 10 seconds.
Unfortunately the only way of refiring with some delay is a custom code (maybe a JobListener
implementation?), refireImmediately
does what it says. It is a pity Quartz does not support it out-of-the-box.
See a proposed solution here (but not the accepted answer): Quartz retry when failure.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With