石英作业详细要求恢复 [英] quartz jobDetail requestRecovery

查看:165
本文介绍了石英作业详细要求恢复的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

JobDetail.requestsRecovery属性的文档规定以下内容

The documentation for JobDetail.requestsRecovery property states the following

指示调度程序是否应重新执行作业 如果遇到恢复"或故障转移"情况.

Instructs the Scheduler whether or not the Job should be re-executed if a 'recovery' or 'fail-over' situation is encountered.

现在,什么是恢复"情况或故障转移"情况?

Now, what is a 'recovery' situation or a 'fail-over' situation?

它们有何不同?

仅在JVM在作业执行过程中崩溃时才进行恢复吗,还是在作业由于异常而执行失败时才进行恢复?

Does the recovery happen only if the JVM crashes during job execution or does it happen if the job execution fails because of an exception also?

推荐答案

"恢复情况"是通用术语,一种恢复情况是"故障转移".

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

故障转移是通常与冗余(例如群集)一起使用的容错系统所使用的过程.在集群中使用Quartz时会使用故障转移,并且 more Quartz的节点"存在.

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.

引用文档:

故障转移是在执行一个或多个作业的过程中,其中一个节点发生故障时发生的.当一个节点发生故障时,其他节点将检测到该情况,并确定故障节点内正在进行的数据库中的作业. 任何标记为要恢复的作业(在JobDetail上具有"requests recovery"属性)将由其余节点重新执行.

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).

要回答第二个问题:

  • 如果JVM在作业执行过程中崩溃,则Quartz将恢复该作业

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

(因为崩溃是恢复情况)

(Because a crash is Recovery situation)

如果由于异常导致作业执行失败> Quartz将无法恢复作业

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

(由于异常不是强制关闭,因此会抛出 misfire )

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

请参见激活工作恢复的答案.

See this answer to activate recovery for your jobs.

这篇关于石英作业详细要求恢复的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆