1. Configure database connection
C:\M\apache-activemq-5.14.1\confactivemq.xml to add database connection data.
1.1 Replace the database connection
<persistenceAdapter> <jdbcPersistenceAdapter dataDirectory="${activemq.base}/data" dataSource="#mysqlDB"/> <!--<kahaDB directory="${activemq.data}/kahadb"/>--> </persistenceAdapter>
1.2 Add connection database information
<bean id="mysqlDB" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName" value="com.mysql.jdbc.Driver"/> <property name="url" value="jdbc:mysql://localhost/test?relaxAutoCommit=true"/> <property name="username" value="root"/> <property name="password" value="root"/> <property name="maxActive" value="200"/> <property name="poolPreparedStatements" value="true"/> </bean>
2. Add the connection data jar file to the MQ reference folder and
download the commons-dbcp.jar, commons-pool.jar, mysql-connector-java.jar files
and copy the jar files to C:\M\apache-activemq-5.14. 1\lib folder
3. Start mq result