activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yan <>
Subject jdbcPersistenceAdapter and delayed messages
Date Tue, 05 Feb 2019 08:08:24 GMT
I recently tried to use ActiveMQ with MySQL as the persistent storage.  I can
configure those two to work with each other and I can see the 3 tables in
However, I noticed that the behavior of delayed messages are unexpected. 

When I set the ScheduledMessage.AMQ_SCHEDULED_DELAY to 60000 (60 seconds),
after I send the message, I expect the message to appear somewhere in MySQL
database so that it is "persistent".  And if I open the admin console
(:8161) I should see an enqueued message in the queue. 

However, the actual behavior is, the message doesn't appear in the
ACTIVEMQ_MSGS table in MySQL database *until* 60 seconds later.  This seems
to tell me that even if I set MySQL database as the persistent storage,
delayed messages (when the time does not come yet) are NOT persistent in the
MySQL database. 

I did some research and it seems that even if I configure MySQL as the
persistent storage, ACTIVEMQ still use file based KahaDB internally.  Can
someone tell me if this is the case, and is there a way to use MySQL to
store the delayed message? 

The snippets of my activemq.xml are: 

  <jdbcPersistenceAdapter dataDirectory="${activemq.base}/data"

<bean id="mysql-ds" class="org.apache.commons.dbcp2.BasicDataSource"
  <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
  <property name="url"
  <property name="username" value="activemq"/>
  <property name="password" value="activemq"/>


Sent from:

View raw message