ACTIVEMQ Persistent MySQL Configuration

Source: Internet
Author: User

Reference: http://blog.csdn.net/zbw18297786698/article/details/52999940

Description: 192.168.3.81 CentOS release 6.5 apache-activemq-5.10.1

1. Copy the MySQL drive to the ACTIVEMQ environment

Mysql-connector-java-5.1.44-bin.jar

[Email protected] apache-activemq-5.10.1]# ls/home/apache-activemq-5.10.1/lib/ Mysql-connector-java-5.1.44-bin.jar

2. Create a database that holds ACTIVEMQ messages

mysql> CREATE DATABASE test_mq DEFAULT CHARACTER SET UTF8 COLLATE utf8_general_ci;

mysql> flush Privileges;

Mysql> Grant all privileges on * * to ' root ' @ ' 192.168.%.% ' identified by '!w2 ';

3. Configuring the Activemq.xml File

[Email protected] apache-activemq-5.10.1]# vim Conf/activemq.xml

Modify the following 2 locations to

4. Restart the ACTIVEMQ service to view the log

[[email protected] apache-activemq-5.10.1]#/bin/activemq start; tail-f./data/activemq.log

At this point, there may be an error, usually the configuration file format (no spaces) is incorrect.

After normal startup, entering the data will result in 3 tables.

Mysql> Show tables;

| TABLES_IN_TEST_MQ |

| Activemq_acks |

| Activemq_lock |

| Activemq_msgs |

Mysql> select * from Activemq_msgs;

Empty Set (0.00 sec)

At this point there is no data in this area.

5. Test data

ACTIVEMQ send data, the receiving end is not open, you can observe that there is a record exists in the ACTIVEMQ_MSGS table.

The following is a test sent 20 records, not receiving the situation

The record value will not be present in the database when the receive is turned on.

ACTIVEMQ Persistent MySQL 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.