how to change activemq's persistence database

how to change activemq's persistence database

 

1、编辑D:/Java/apache-servicemix-4.3.0-fuse-03-00/etc/activemq-broker.xml,

(1)将<persistenceAdapter>
                <kahaDB directory="${karaf.data}/activemq/default/kahadb"/>
            </persistenceAdapter>
替换为<persistenceAdapter>
                <jdbcPersistenceAdapter dataSource="#mysql-ds"/>
            </persistenceAdapter>
或者<persistenceFactory>
              <journaledJDBC journalLogFiles="5" dataSource="#mysql-ds" />
          </persistenceFactory>

(2)在</blueprint>之前添加:

<bean id="mysql-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
        <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
        <property name="url" value="jdbc:mysql://localhost/jms?relaxAutoCommit=true"/>
        <property name="username" value="root"/>
        <property name="password" value=""/>
        <property name="poolPreparedStatements" value="true"/>
    </bean>
2、启动apache-servicemix-4.3.0-fuse-03-00:activemq-broker.xml为“installed”

注意:一定要先修改activemq-broker.xml,再启动servicemix

3、install commons-dbcp 包:

osgi:install -s mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-dbcp/1.2.2_5

4、osgi:restart (activemq-broker.xml的osgi id)  或重启servicemix

 

 

 

 

 

 

 

 

 

 

 

阅读更多
个人分类: activemq and jms Java
上一篇jms 的基本概念
下一篇how to configure and use activemq in camel
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭