同一服务器实例和同一个jobstore上的多个Quartz实例

问题描述 投票:1回答:3

我们有2个使用石英进行调度的应用程序。我们的应用的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 store相同的表集。

现在的问题是:

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

应用程序是否应在同一数据库中使用不同的石英表集?对于多个应用程序,每个服务器应该只有一个石英调度程序实例吗?

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

顺便说一下,我们使用石英1.8。

任何帮助表示赞赏。

谢谢,Sri Harsha Yenuganti。

quartz-scheduler
3个回答
1
投票
"The other application have the same configuration but with a different instanceName."

要启用群集:

  • 仅使用SINGLE调度程序实例名称(但具有不同的实例ID)
  • 指向一组表

0
投票

Quartz 2.0及更高版本支持此功能。


0
投票

在版本1.x上,您必须为每个调度程序使用多个表集。

在版本2.x上,您可以使用一组表。每个表上都有一个新的鉴别器列,其中包含调度程序名称(SCHED_NAME)。

© www.soinside.com 2019 - 2024. All rights reserved.