You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by "Christopher G. Stach II" <cg...@ldsys.net> on 2006/01/02 16:54:50 UTC

ActiveMQ 3.2.1 not redelivering after exception

I'm using Spring 1.2.6 JtaTransactionManager w/annotations with the
GeronimoTransactionManagerFactoryBean and Jencks 1.1.1 to run some
message-driven POJOs.  When getting an exception in the POJO, I see that
the rollback happens properly, although the message is not redelivered
from the Queue.  I'm pretty sure I've narrowed down where this happens.

At ActiveMQSession:570, afterMessageDelivered is called with
beforeCalled being true.  Inside of afterMessageDelivered, the message
that was delivered, processed, and got an exception is removed from the
deliveredMessages collection.  Later on in the process, the redelivery
mechanism uses that collection, but it is of course empty.

So, what we have happening is a successful queue, a delivery, an
exception, a rollback, but no redelivery.  I really don't think that
this is somehow related to configuration, because in certain other cases
I actually do get a redelivery.  It's not always the same number of
times, and rarely the configured number of times in activemq.xml.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC
	"-//ACTIVEMQ//DTD//EN"
	"http://activemq.org/dtd/activemq.dtd">

<beans default-lazy-init="false" default-dependency-check="none"
default-autowire="no">

	<broker name="brokeroffice">
		<connector>
			<tcpServerTransport uri="tcp://localhost:0"
			                    backlog="1000"
			                    useAsyncSend="false"
			                    maxOutstandingMessages="50" />
		</connector>

		<discoveryAgent>
			<zeroconfDiscovery type="_activemq.broker.foo.dev." />
		</discoveryAgent>

		<discoveryNetworkConnector />

		<persistence>
			<journalPersistence directory="activemq/journal">
				<jdbcPersistence dataSourceRef="derby-ds" />
			</journalPersistence>
		</persistence>

		<redeliveryPolicy maximumRetryCount="10" backOffMode="true"
initialRedeliveryTimeout="2000" />
	</broker>

	<bean id="derby-ds" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
		<property name="driverClassName">
			<value>org.apache.derby.jdbc.EmbeddedDriver</value>
		</property>

		<property name="password">
			<value></value>
		</property>

		<property name="poolPreparedStatements">
			<value>true</value>
		</property>

		<property name="url">
			<value>jdbc:derby:activemq/derbydb;create=true</value>
		</property>

		<property name="username">
			<value></value>
		</property>
	</bean>

</beans>