Active MQ (5.14.3) JDBC setup on Mysql(5.7.17)
-------------------------------------
CREATE DATABASE activemq;
CREATE USER 'activemq'@'%' IDENTIFIED BY 'activemq';
GRANT ALL ON activemq.* TO 'activemq'@'%';
flush privileges;
2. cp mysql-connector-java-5.1.22-bin.jar /opt/activemq/lib/optional/
3. sudo chown -R activemq:activemq mysql-connector-java-5.1.22-bin.jar
4. sudo nano /opt/activemq/conf/activemq.xml
modify:
<persistenceAdapter>
<jdbcPersistenceAdapter dataDirectory="${activemq.base}/data" dataSource="#mysql-ds"/>
</persistenceAdapter>
add the following bean just after the ending broker element (</broker>)
<bean id="mysql-ds" class="org.apache.commons.dbcp2.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="xxxxx"/>
<property name="password" value="xxxxx"/>
<property name="poolPreparedStatements" value="true"/>
</bean>
CREATE USER 'activemq'@'45.56.91.233' IDENTIFIED BY 'activemq';
ReplyDeleteGRANT ALL ON activemq.* TO 'activemq'@'45.56.91.233';
flush privileges;
UPDATE mysql.user SET Host='%' WHERE Host='45.56.91.233' AND User='activemq';
ReplyDeleteUPDATE mysql.db SET Host='%' WHERE Host='45.56.91.233' AND User='activemq';
FLUSH PRIVILEGES;
select user,host from mysql.user;
ReplyDeleteActive MQ log
ReplyDelete/opt/activemq/data/activemq.log