gpt4 book ai didi

java - Quartz 的 @DisallowConcurrentExecution 是否可以跨多个 JVM 工作?

转载 作者:行者123 更新时间:2023-11-30 03:00:29 24 4
gpt4 key购买 nike

如果我使用 JdbcStore 将作业代码部署在两个 JVM 上,@DisallowConcurrentExecution 能否确保所有 JVM 上仅运行一个作业?

最佳答案

是的,会的;这种属性甚至适用于多个实例。这里唯一重要的是,这个属性是基于 JobKey 的,而不是 here 中描述的代码。 .

无论如何,提醒一下,不要在多个服务器上运行 Quartz,除非你有一个守护进程来保持时钟同步。来自 quartz 指南:

Never run clustering on separate machines, unless their clocks are synchronized using some form of time-sync service (daemon) that runs very regularly (the clocks must be within a second of each other). See http://www.boulder.nist.gov/timefreq/service/its.htm if you are unfamiliar with how to do this.

关于java - Quartz 的 @DisallowConcurrentExecution 是否可以跨多个 JVM 工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36136122/

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