quartz jobDetail requestRecovery

萝らか妹 提交于 2019-12-05 04:19:44
zerologiko

A "Recovery situation" is the generic term, one kind of recovery situation is the "fail-over".

A fail-over is a process used by fault-tolerance systems generally used with redundancy (e.g. clustering). Quartz use fail-over when is used in clustering and more Quartz "nodes" exists.

Quoting documentation:

Fail-over occurs when one of the nodes fails while in the midst of executing one or more jobs. When a node fails, the other nodes detect the condition and identify the jobs in the database that were in progress within the failed node. Any jobs marked for recovery (with the "requests recovery" property on the JobDetail) will be re-executed by the remaining nodes.

A recovery situation is every situation that produce an "Hard-shutdown" (i.e. the process it is running within crashes, or the machine is shut down).


To answer your second question:

  • If the JVM crashes during a job execution > Quartz will recover the job

    (Because a crash is Recovery situation)

  • if the job execution fails because of an exception > Quartz will not recover the job

    (Because exception is not an hard-shutdown, a misfire is thrown instead)

See this answer to activate recovery for your jobs.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!