Quartz 的@DisallowConcurrentExecution 是否跨多个 JVM 工作?

Does Quartz's @DisallowConcurrentExecution works across multiple JVMs?

如果我使用 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.