gpt4 book ai didi

quartz-scheduler - 同一服务器实例和同一作业存储上的多个 Quartz 实例

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

我们有 2 个应用程序使用 quartz 进行调度。我们应用程序的 quartz.properties 如下:

org.quartz.scheduler.instanceName = sr22QuartzScheduler
org.quartz.scheduler.instanceId = AUTO
org.quartz.scheduler.skipUpdateCheck = true

org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount = 2
org.quartz.threadPool.threadPriority = 5

org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX
org.quartz.jobStore.isClustered = true
org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.StdJDBCDelegate
org.quartz.jobStore.useProperties = false
org.quartz.jobStore.dataSource = quartzDS
org.quartz.jobStore.tablePrefix = QRTZ_
org.quartz.jobStore.clusterCheckinInterval = 20000
org.quartz.scheduler.idleWaitTime=1000
#org.quartz.jobStore.acquireTriggersWithinLock=true
#Adding unusually high misfire threshold as we dont want to handle misfires
org.quartz.jobStore.misfireThreshold = 50000000
#org.quartz.jobStore.maxMisfiresToHandleAtATime = 0

org.quartz.dataSource.quartzDS.jndiURL= java:jdbc/quartzDS

org.quartz.plugin.shutdownhook.class = org.quartz.plugins.management.ShutdownHookPlugin
org.quartz.plugin.shutdownhook.cleanShutdown = false

#org.quartz.plugin.triggHistory.class = org.quartz.plugins.history.LoggingTriggerHistoryPlugin
#org.quartz.plugin.triggHistory.triggerFiredMessage = Trigger \{1\}.\{0\} fired job \{6\}.\{5\} at: \{4, date, HH:mm:ss MM/dd/yyyy}
#org.quartz.plugin.triggHistory.triggerCompleteMessage = Trigger \{1\}.\{0\} completed firing job \{6\}.\{5\} at \{4, date, HH:mm:ss MM/dd/yyyy\}

另一个应用程序具有相同的配置,但具有不同的 instanceName。

两个应用程序都将在同一组服务器实例上运行。它们都使用与数据库中 Quartz Job 存储相同的一组表。

现在的问题是:

如果两个应用程序同时运行,则触发器不会正确路由。来自 application1 的触发器被路由到 application2,反之亦然。这是随机发生的。

应用程序是否应该在同一数据库中使用不同的 quatrz 表集?对于多个应用程序,我们是否应该在每台服务器上只有一个 quartz 调度程序实例?

我看到 quartz 的随机行为。我们的设置有什么问题吗??

顺便说一句,我们使用的是 quartz 1.8。

感谢任何帮助。

谢谢,Sri Harsha Yenuganti。

最佳答案

"The other application have the same configuration but with a different instanceName."

启用集群:

  • 仅使用单个调度程序实例名称(但具有不同的实例 ID)

  • 指向一组表

关于quartz-scheduler - 同一服务器实例和同一作业存储上的多个 Quartz 实例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17069594/

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