Quartz job exception fixed so that it performs the next regular move without immediately deleting it immediately

How can I handle the “exceptions” caused by a job run by the Quartz scheduler so that it runs at the next scheduled time. I do not want him to be redirected immediately, or I do not want him to refuse this work. Just keep it in the store until your next move.

+4
source share
1 answer

If you selected an exception from Job and did not JobExecutionException with refireImmediately , this execution will be canceled and the normal schedule will continue. For instance. when a task should run every 10 seconds and one execution throws an exception, Quartz will simply cancel this exception and start the next one after 10 seconds.

Unfortunately, the only way to delay again with some delay is to use native code (perhaps an implementation of JobListener ?), refireImmediately does what it says. It is a pity that quartz does not support it out of the box.

See suggested solution here (but not accepted answer): Quartz repetitions on failure .

+3
source

Source: https://habr.com/ru/post/1403848/


All Articles