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 存储相同的一组表。

现在的问题是:

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

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

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

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

任何帮助表示赞赏。

谢谢,Sri Harsha Yenuganti。

4

3 回答 3

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

要启用集群:

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

  • 指向一组表

于 2014-08-04T08:00:06.737 回答
2

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

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

于 2019-02-21T12:36:04.673 回答
0

Quarts 2.0 及以上版本支持此功能。

于 2013-09-11T05:12:40.673 回答