1、activemq可以使用jdbc高可用配置,且配置简单
vim conf/activemq.xml
#修改 <borker> 节点的 brokerName 属性,新加入 persistent 属性。
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="127.0.0.1" persistent="true" dataDirectory="${activemq.data}">
# <persistenceAdapter> 节点下面配置如下代码,将默认的<kahaDB directory="${activemq.data}/kahadb"/>注释
<persistenceAdapter>
<jdbcPersistenceAdapter dataDirectory="${activemq.base}/activemq-data" dataSource="#mysql-ds"/>
</persistenceAdapter>
#在 <broker> 节点外面新增如下内容
<!-- MySql DataSource Master Slave -->
<bean id="mysql-ds" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="url