activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sandeep Chayapathi <>
Subject jdbcPersistenceAdapter enlightenment
Date Mon, 05 Feb 2007 15:20:59 GMT

Hi all,

 As a followup to these questions:

how to set the message... Queue Memory limit
Async exception 

My bane of existence has been activemq, for a while now. The single issue, 
is activemq running out of heap memory, when I use offline durable
subscribers. I wondered if by using db persistence, instead of caching
messages, would solve this proble. To that end, I modified my activemq.xml,

  <broker brokerName="localhost" useJmx="true"
xmlns="" persistent="true">
        <usageManager id="memory-manager" limit="1024 MB"/>
        <jdbcPersistenceAdapter dataSource="#mysql-ds"/>
  <!-- MySql DataSource Sample Setup -->
  <bean id="mysql-ds" class="org.apache.commons.dbcp.BasicDataSource"
    <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
    <property name="url"
    <property name="username" value="sandeep"/>
    <property name="password" value="password"/>
    <property name="poolPreparedStatements" value="false"/>


I had 3 offline durable subscribers, to a topic (tired with queues also) and
1 producer, which pumped in messages to the topic. The jvm was started with

I found that, although the messages were supposed to be persisted to the
mysql db, all the tables were empty. Once the memory usage hit the jvm's max
allocated memory, I got the dreaded 
"java.lang.OutOfMemoryError: Java heap space", yet no messages were found in
the datastore.

Can anyone pls enlighten me why the un-acked messages were not being
persisted to the datastore and if there is a way to force activemq to
persist messages ? Thanks

- Sandeep
View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message