gpt4 book ai didi

quartz-scheduler - quartz 作业详细请求恢复

转载 作者:行者123 更新时间:2023-12-04 07:54:45 28 4
gpt4 key购买 nike

JobDetail.requestsRecovery 的文档属性(property)声明如下

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



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

它们有何不同?

恢复是仅在 JVM 在作业执行期间崩溃时才发生,还是在作业执行也因异常而失败时发生?

最佳答案

“恢复情况”是通用术语,一种恢复情况是“故障转移”。

A 故障转移 是容错系统使用的过程,通常与冗余一起使用(例如集群)。 Quartz 在集群中使用时使用故障转移,并且存在更多 Quartz “节点”。

报价 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 恢复情况是产生“硬关机”的每种情况(即它在崩溃中运行的进程,或机器关闭)。

回答你的第二个问题:
  • 如果 JVM 在作业执行期间崩溃 > Quartz 将恢复作业

    (因为crash是Recovery的情况)
  • 如果作业执行因异常而失败 > Quartz 不会恢复作业

    (因为异常不是硬关机,而是抛出失火)

  • this为您的工作激活恢复的答案。

    关于quartz-scheduler - quartz 作业详细请求恢复,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19267263/

    28 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com