activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DinDon <>
Subject AMQ 5.1 - Re-queued msg are redelivered again after restart
Date Fri, 29 Feb 2008 06:18:16 GMT

Hello guys,

I am new to JMS and ActiveMQ(apache-activemq-5.1-20080220.151243-27), and I
have been testing ActiveMQ with SpringJMS and Jencks for a week, and googled
with no luck for the following issues.

- Re-queued messages only being redelivered after restarting AMQ
- In my MessageListener.onMessage(Message message) method, I throw a
RuntimeException() for testing redelivery.

Here is the Spring Config which I followed some tutorials:

	<bean id="jmsTransactionManager"
		class="org.jencks.factory.TransactionManagerFactoryBean" />

	<bean id="connectionManager"
		<property name="transactionManager" ref="jmsTransactionManager" />

	<bean id="jmsResourceAdapter"
		<property name="serverUrl" value="${}" />
		<property name="userName" value="${}" />
		<property name="password" value="${}" />
		<property name="initialRedeliveryDelay" value="5" />
		<property name="maximumRedeliveries" value="2" />

	<bean id="jmsManagedConnectionFactory"
		<property name="resourceAdapter" ref="jmsResourceAdapter" />
		<property name="initialRedeliveryDelay" value="10" />
		<property name="maximumRedeliveries" value="2" />

	<bean id="jmsConnectionFactory"
		<property name="managedConnectionFactory"
			ref="jmsManagedConnectionFactory" />
		<property name="connectionManager" ref="connectionManager" />

	<bean id="jmsTemplate"
		<property name="connectionFactory">
			<ref bean="jmsConnectionFactory" />

	<bean id="jencks" class="org.jencks.JCAContainer"
		<property name="transactionManager" ref="jmsTransactionManager" />
		<property name="threadPoolSize" value="25" />
		<property name="resourceAdapter" ref="jmsResourceAdapter" />

	<bean id="mailingQueueMessageListener"
		class="com.ifshk.pms.jms.MailingQueueMessageListener" />

	<bean id="inputQueueMessageListenerContainer"
		<property name="connectionFactory" ref="jmsConnectionFactory" />
		<property name="destinationName" value="${}" />
		<property name="messageListener"
			ref="mailingQueueMessageListener" />
		<property name="transactionManager" ref="jmsTransactionManager" />
		<property name="sessionTransacted" value="true" />

		<bean id="inboundConnectorA" class="org.jencks.JCAConnector">
		<property name="jcaContainer" ref="jencks" />
		<property name="activationSpec">
		<property name="destination" value="${}" />
		<property name="destinationType"
		value="javax.jms.Queue" />
		<property name="ref" value="mailingQueueMessageListener" />

Initially, I used inboundConnectorA for receiving Message, but it seems
jencks doesn't rollback a message automatically when an exception occurs. So
I switched to DefaultMessageListenerContainer, and rollback does work but
the re-queued messages only being redelivered again after I restart AMQ, and
those messages never be marked as DEAD and sent to a dead queue.

Please advice.

Thanks a lot & regards,
View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message