[英]ActiveMQ Scheduler Failover with JDBC MasterSlave
I currently have a working two-broker JDBC MasterSlave configuration, and the next step for me is to implement a scheduler with failover. 我目前有一个可用的两代理JDBC MasterSlave配置,对我来说,下一步是实现具有故障转移功能的调度程序。 I've looked around and haven't seen any information about this, and was curious to see if this is possible or if I should try a different approach. 我四处张望,没有看到任何有关此的信息,并很好奇是否可行,或者是否应该尝试其他方法。
Currently, I have the two brokers using the same dataDirectory both within the broker tag and the JDBCPersistenceAdapter tag. 当前,我有两个代理,它们在broker标记和JDBCPersistenceAdapter标记内都使用相同的dataDirectory。 However, within that data directory ActiveMQ creates two separate scheduler folders. 但是,ActiveMQ在该数据目录中创建两个单独的调度程序文件夹。 I cannot seem to force it to use the same one, so failover with scheduling isn't working. 我似乎无法强迫它使用相同的服务器,因此无法进行具有计划的故障转移。
I've also tried the KahaDB approach with the same criteria, and that doesn't seem to work either. 我还用相同的标准尝试了KahaDB方法,但这似乎也不起作用。
Another option would be for the scheduler information to be pushed to the database (in this case, oracle) and be able to be picked up from there (not sure if possible). 另一种选择是将调度程序信息推送到数据库(在本例中为oracle),并能够从那里获取(不确定是否可能)。
Here is a basic overview of what I need: 这是我需要的基本概述:
activemq.xml (relevant parts) activemq.xml(相关部分)
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="b1" useJmx="true"
persistent="true" schedulerSupport="true">
<!-- kahaDB persistenceAdapter -->
<persistenceAdapter>
<kahaDB directory="{activemq.data}/kahadb" enableIndexWriteAsync="false"
ignoreMissingJournalfiles="true" checkForCorruptJournalFiles="true"
checksumJournalFiles="true"/>
</persistenceAdapter>
<!-- JDBC persistenceAdapter -->
<persistenceAdapter>
<jdbcPersistenceAdapter dataDirectory="{activemq.data}" dataSource="#oracle-ds"/>
</persistenceAdapter>
Can someone possibly point me in the right direction? 有人可以指出我正确的方向吗? I'm fairly new to ActiveMQ. 我是ActiveMQ的新手。 Thanks in advance! 提前致谢!
If anyone is curious, adding the schedulerDirectory property to the broker tag seems to be working fine. 如果有人好奇,将schedulerDirectory属性添加到broker标记似乎工作正常。 So my broker tag in activemq.xml now looks like this: 因此,activemq.xml中的我的代理标签现在看起来像这样:
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="broker1"
dataDirectory="{activemq.data}" useJmx="true" persistent="true"
schedulerSupport="true" schedulerDirectory="{activemq.data}/broker1/scheduler"/>
You have probably figured out what you need to do to make this work, but for the sake of other folks like me who was/is looking for the answer. 您可能已经想出了完成此工作所需要做的工作,但是为了像我这样正在寻找答案的其他人。 if you're trying to make failover work for scheduled messages with the default kahaDb store (as of v 5.13.2) and a shared file system, you will need to do the following: 如果您要使用默认的kahaDb存储(自5.13.2版开始)和共享文件系统来使计划消息的故障转移正常工作,则需要执行以下操作:
Example: 例:
<broker xmlns="http://activemq.apache.org/schema/core"
brokerName="myBroker1"
dataDirectory="/shared/folder"
schedulerSupport="true">
我建议在ActiveMQ上支持问题https://issues.apache.org/jira/browse/AMQ-5238 ,因为即使您不使用计划的消息,也可以使用重新交付策略来解决计划程序问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.