activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Tully <gary.tu...@gmail.com>
Subject Re: ActiveMQ, Camel, RedeliveryDelay configuration is not used, immediate redlivery instead.
Date Mon, 30 Sep 2013 14:11:43 GMT
check the cache level. The consumer (where amq does redelivery) is
probably closed after each receipt, so the broker just does a
redispatch to one of the other available consumers.
The broker redelivery plugin can help but the root cause is session
level transaction enlistment which is done on session create.

On 26 September 2013 21:19, eschorsch@sendmail.com
<eschorsch@sendmail.com> wrote:
> Hello,
>
> We are using a Camel/ActiveMQ/Spring configuration. We have setup a
> persistent queue backed by Kaha, and transactional configuration using
> org.springframwork.jms.connection.JmsTransactionManager.
>
> We are trying to get the exception/re-delivery working correctly, and find
> that while the maximumRedeliveries configuration is honored, the
> redeliveryDelay is not. Rather, redelivery is executed immediately when the
> exceptioning consumer is finished executing it's
> rollback/close/synchronization logic.
>
> Any input/experience would help...
>
> The most confusing thing here, is that there redelivery count is honored,
> and running the code in the debugger we see the redeliveryDelay is set, and
> calculated correctly. There is even a scheduled task set to redeliver the
> message. However, as the infrastructure (ActiveMQMessageConsumer) is
> iterating through it's synchronizations during the rollback processing, a
> call to ActiveMQMessageConsumer.synchronization.afterRollback() results in
> an immediate redelivery of the message.
>
>
> /Below is our actual configuration./
>
>
> Our JMS configuration:
>
>
>     <bean id="jms"
> class="org.apache.activemq.camel.component.ActiveMQComponent">
>         <property name="configuration">
>             <bean class="org.apache.camel.component.jms.JmsConfiguration">
>                 <property name="transacted" value="true"/>
>                 <property name="transactionManager"
> ref="jmsTransactionManager"/>
>                 <property name="errorHandlerLogStackTrace" value="false"/>
>
>
>                 <property name="concurrentConsumers"
> value="${jms.concurrentConsumers:10}" />
>                 <property name="connectionFactory"
> ref="jmsConnectionFactory"/>
>             </bean>
>         </property>
>     </bean>
>     <bean id="jmsConnectionFactory"
> class="org.apache.activemq.pool.PooledConnectionFactory" init-method="start"
> destroy-method="stop">
>         <property name="maxConnections" value="${jms.maxConnections:8}" />
>         <property name="connectionFactory">
>             <bean class="org.apache.activemq.ActiveMQConnectionFactory">
>                 <property name="brokerURL"
> value="tcp://${jms.host:localhost}:${jms.port:8791}" />
>                 <property name="redeliveryPolicyMap"
> ref="jmsRedeliveryPolicyMap" />
>             </bean>
>         </property>
>         <property name="idleTimeout" value="0" />
>     </bean>
>     <amq:redeliveryPolicyMap id="jmsRedeliveryPolicyMap">
>         <amq:redeliveryPolicyEntries>
>             <bean class="org.apache.activemq.RedeliveryPolicy">
>                 <property name="queue" value="mailSender" />
>                 <property name="redeliveryDelay" value="#{ 1000 *
> ${mta.redeliveryDelay:300}}" />
>                 <property name="initialRedeliveryDelay" value="#{1000 *
> ${mta.redeliveryDelay:300}}" />
>                 <property name="maximumRedeliveryDelay" value="#{1000 *
> ${mta.redeliveryDelay:300}}" />
>                 <property name="maximumRedeliveries"
> value="${mta.maximumRedeliveries:3}" />
>             </bean>
>         </amq:redeliveryPolicyEntries>
>         <amq:defaultEntry>
>             <amq:redeliveryPolicy maximumRedeliveries="0" />
>         </amq:defaultEntry>
>     </amq:redeliveryPolicyMap>
>
> our camel/consumer configuration:
>        <camel:route id="mailSenderJMSConsumer">
>             <camel:from uri="jms:queue:mailSender" />
>             <camel:transacted/>
>
>
>             <camel:onException redeliveryPolicyRef="emailSendFailurePolicy">
>
> <camel:exception>com.sendmail.reac.email.RetryableEmailException</camel:exception>
>
>                 <camel:handled>
>                     <camel:constant>false</camel:constant>
>                 </camel:handled>
>                 <camel:log loggingLevel="WARN" message="${exception}"
> logName="com.sendmail.reac.camel"/>
>             </camel:onException>
>
>
>             <camel:onException redeliveryPolicyRef="emailSendFailurePolicy">
>                 <camel:exception>java.lang.Throwable</camel:exception>
>
>                 <camel:handled>
>                     <camel:constant>true</camel:constant>
>                 </camel:handled>
>                 <camel:log loggingLevel="ERROR" message="${exception}"
> logName="com.sendmail.reac.camel"/>
>             </camel:onException>
>
>
>            <camel:to
> uri="bean:mailSender?method=createMimeMessageFromEmlString(${out.body})" />
>            <camel:to uri="ref:emailEndpoint" />
>        </camel:route>
>
>
>
> thanks for any insight!
>
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-Camel-RedeliveryDelay-configuration-is-not-used-immediate-redlivery-instead-tp4671869.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.



-- 
http://redhat.com
http://blog.garytully.com

Mime
View raw message