activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ken DeLong <>
Subject Intermittent delayed delivery
Date Fri, 14 Sep 2012 18:03:21 GMT
We are using ActiveMQ 5.5.1 as an embedded broker in our Spring 3.1.0 application. We have
enabled message redelivery.  From time to time, we see messages that are sent to the queue,
but are never delivered, or are delivered hours later.  We've gone through the posts on using
Spring's JMS Template with ActiveMQ and think we have the proper settings.

Our current theory is that perhaps when messages throw a RuntimeException, and get re-enqueued
for later delivery, the consumers are not released and the new messages can't be delivered.
 However, we can't really gather much evidence to support this.

I'm including  the configuration that we are using, in the hopes that someone might spot something
that we have got wrong.

<amq:broker id="jmsBroker" useJmx="true" persistent="true"
       brokerName="localhost" dataDirectory="${catalina.home}/data/intl2/jms"
                           <amq:policyEntry topic=">" producerFlowControl="false" memoryLimit="1mb"
                                  <amq:vmCursor />
                           <!-- Prefetch :
                                Flow control:
                                Stuck messages:
                           <amq:policyEntry queue=">" producerFlowControl="false" memoryLimit="1mb"
useCache="false" queuePrefetch="1">
                                  <!-- Use VM cursor for better latency For more information,
                                         <pendingQueuePolicy> <vmQueueCursor/>
</pendingQueuePolicy> -->
              <amq:managementContext createConnector="false" />
              <amq:kahaDB directory="${catalina.home}/data/intl2/jms/kahadb"
                     checkForCorruptJournalFiles="true" checksumJournalFiles="true"
                     forceRecoverIndex="true" />

<!-- <bean id="jmsConnectionFactory" class="org.apache.activemq.pool.PooledConnectionFactory"
       destroy-method="stop"> -->
<bean id="jmsConnectionFactory" class="org.springframework.jms.connection.CachingConnectionFactory">
       <property name="targetConnectionFactory">
              <bean class="org.apache.activemq.spring.ActiveMQConnectionFactory">
                     <property name="brokerURL" value="vm://localhost" />
                     <property name="redeliveryPolicy">
                           <bean class="org.apache.activemq.RedeliveryPolicy">
                                  <property name="maximumRedeliveries"    value="15" />
                                  <property name="initialRedeliveryDelay" value="10800000"
                                  <property name="redeliveryDelay"        value="10800000"

<bean id="eventServiceJmsTemplate" class="org.springframework.jms.core.JmsTemplate">
       <property name="connectionFactory" ref="jmsConnectionFactory" />
       <property name="defaultDestination" ref="destination" />
       <property name="pubSubDomain" value="false" />
       <property name="deliveryPersistent" value="true" />

<bean id="destination" class="org.apache.activemq.command.ActiveMQQueue">
       <property name="physicalName" value="asynchQueue" />

<bean id="destinationResolver" class=""
     Tracing through Spring's code, it seems that it will not roll back the transaction unless
we set acknowledge to "transacted"
     I tested it on integ, messages are not being redelivered with "auto", but they are in
"transacted" mode
     Cache none:
<jms:listener-container connection-factory="jmsConnectionFactory"
       <jms:listener destination="destination" ref="asynchronousEventExecutor" />

Kenneth DeLong |  Director of Architecture, Chief Software Architect
o: 415.344.7616<>
Twitter: kenwdelong
AIM: kenwdelong<>

like BabyCenter on Facebook<>

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message