You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Mykola <mp...@gmail.com> on 2007/05/04 14:29:49 UTC

Redelivery Policy does not work AMQ 4.1.1

Hi All.
I fased the problem with redelivery policy, it simply does not work for
following config

Factory:
	<bean id="jmsConnectionFactory"
		class="org.apache.activemq.pool.PooledConnectionFactory"
		init-method="start" destroy-method="stop">
		<property name="connectionFactory">
			<bean
				class="org.apache.activemq.ActiveMQConnectionFactory">
				<property name="brokerURL"
					value="${jms.remotehost.uri}" />
				<property name="redeliveryPolicy">
					<bean class="org.apache.activemq.RedeliveryPolicy">
						<property name="backOffMultiplier" value="3"/>
						<property name="useExponentialBackOff" value="true"/>
						<property name="maximumRedeliveries" value="11"></property>
						<property name="initialRedeliveryDelay" value="2000"></property>
					</bean>
				</property>
			</bean>
		</property>
	</bean>

Listener, I'm using Spring Container with transaction enabled

    <bean
class="org.springframework.jms.listener.DefaultMessageListenerContainer">
        <property name="autoStartup" value="${jms.sms.start}" />
        <property name="concurrentConsumers"
value="${jms.sms.concurrent.consumers}" />
        <property name="connectionFactory" ref="jmsConnectionFactory" />
        <property name="destination" ref="jmsSmsDestination" />
        <property name="messageListener" ref="smsJmsListener" />
        <property name="sessionTransacted" value="true"></property>
    </bean>

In message bean I just put

   public void onMessage(Message message) {
        throw new IllegalArgumentException();
    }

As a result I see endless calls of onMessage 
the same is if I set redelivery policy via URL like
jms.remotehost.uri=tcp://localhost:61616?jms.redeliveryPolicy.initialRedeliveryDelay=2000&jms.redeliveryPolicy.maximumRedeliveries=6

What am I doing wrong? The queue I subscribe is 
	<bean id="jmsSmsDestination"
		class="org.apache.activemq.command.ActiveMQQueue">
		<constructor-arg>
			<value>QUEUE.SMS</value>
		</constructor-arg>
	</bean>


Thanks in advance
-- 
View this message in context: http://www.nabble.com/Redelivery-Policy-does-not-work-AMQ-4.1.1-tf3691771s2354.html#a10321739
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Redelivery Policy does not work AMQ 4.1.1

Posted by Mykola <mp...@gmail.com>.
Fixed
use org.springframework.jms.listener.SimpleMessageListenerContainer instead,
Default one just refetches the message in endless loop. Simple one uses
redelivery policy to do that. No idea why default behavior in Spring so
weird
-- 
View this message in context: http://www.nabble.com/Redelivery-Policy-does-not-work-AMQ-4.1.1-tf3691771s2354.html#a10371136
Sent from the ActiveMQ - User mailing list archive at Nabble.com.