ActiveMQ Persistent Configuration

Source: Internet
Author: User

Install ACTIVEMQ in Mac

Brew Install ACTIVEMQ

Start

ACTIVEMQ start

Console: Enter url:http://localhost:8161/in the browser

A: Persistent to file

This is the default when you install ACTIVEMQ, as long as you set the message to persistent. The configuration and code involved are

<persistenceAdapter>
&LT;KAHADB directory= "${activemq.base}/data/kahadb"/>
</persistenceAdapter>

Producer. Send (Request, msgdeliverymode.persistent, level, timespan.minvalue);

B: Persistent to MySQL

You first need to put the MySQL driver into the activemq Lib directory, I use the file name is: Mysql-connector-java-5.0.4-bin.jar

Next you modify the configuration file

<persistenceAdapter>
<jdbcpersistenceadapter datadirectory= "${activemq.base}/data" datasource= "#derby-ds"/>
</persistenceAdapter>

Increased outside the broker node in the configuration file

<bean id= "Derby-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/activemq?relaxautocommit=true"/>
<property name= "username" value= "activemq"/>
<property name= "Password" value= "Activemq"/>
<property name= "maxactive" value= "/>"
<property name= "Poolpreparedstatements" value= "true"/>
</bean>

From the configuration you can see that the name of the database is ACTIVEMQ, you need to manually add this library in MySQL.

And then restart Message Queuing, and you'll find 3 more sheets.

1:activemq_acks

2:activemq_lock

3:activemq_msgs

C: Persistent to Oracle

and persistent as MySQL.

ActiveMQ Persistent Configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.