You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by joeleclems <jo...@free.fr> on 2015/01/09 17:15:30 UTC

activemq.xml Embedded Tomee redeliveryDelay

Hi,

I'm trying to apply redelivery policy to message posted in activemq. I'm
using tomee+ 1.7.0 (with activemq 5.10.0) and i use an external
configuration file (activemq.xml).
I follow the online documentation
(http://activemq.apache.org/message-redelivery-and-dlq-handling.html), but
the redelivery policy is not used at all!
This is my activemq.xml :
/<beans ...>
  <broker xmlns="http://activemq.apache.org/schema/core" useJmx="true"
start="true" brokerName="PMBrokerConfXml" schedulerSupport="true"
persistent="true">
        <destinationPolicy>
                <policyMap>
                  <policyEntries>
                        <policyEntry queue=">" producerFlowControl="true" >
                                <deadLetterStrategy>
                                <individualDeadLetterStrategy
                                  queuePrefix="ERROR."
useQueueForQueueMessages="true" />
                          </deadLetterStrategy>
                        </policyEntry>
                  </policyEntries>
                </policyMap>
        </destinationPolicy>

        <plugins xmlns="http://activemq.apache.org/schema/core">
                <redeliveryPlugin fallbackToDeadLetter="true"
sendToDlqIfMaxRetriesExceeded="true">
                  <redeliveryPolicyMap >
                        <redeliveryPolicyMap>
*                         
                          <defaultEntry>
                                <redeliveryPolicy
initialRedeliveryDelay="5000"
                                                                       
redeliveryDelay="3000"
                                                                       
maximumRedeliveries="3"
                                                                       
maximumRedeliveryDelay="14400000"
                                                                       
backOffMultiplier="2"
                                                                       
useExponentialBackOff="true"/>*
                          </defaultEntry>
                        </redeliveryPolicyMap>
                  </redeliveryPolicyMap>
                </redeliveryPlugin>
        </plugins>

    <persistenceAdapter>
      <kahaDB directory="D:/apache-tomee-1.7.0-plus/jmsdata/kahadb"
indexCacheSize="20000" ignoreMissingJournalfiles="true"
checkForCorruptJournalFiles="true" checksumJournalFiles="true"/>
    </persistenceAdapter>

   
    <transportConnectors>
                <transportConnector uri="tcp://localhost:61616" />
        </transportConnectors> 

        <systemUsage>
                <systemUsage>
                        <memoryUsage>
                                <memoryUsage limit="64 mb"/>
                        </memoryUsage>
                        <storeUsage>
                                <storeUsage limit="100 gb"/>
                        </storeUsage>
                        <tempUsage>
                                <tempUsage limit="50 gb"/>
                        </tempUsage>
                </systemUsage>
        </systemUsage>
               
        <shutdownHooks>
                <bean xmlns="http://www.springframework.org/schema/beans"
class="org.apache.activemq.hooks.SpringContextHook" />
        </shutdownHooks>
               
  </broker>
</beans>/

What's working :
 - i can send message to activemq
 - i can see theses messages in activemq webconsole
 - i can consume message
 - When i send a "transaction rollback" during message consuming, after 6
try, messages are sent to "ERROR.[QueueName]" queue

What's not working :
 - all the redeliveryPolicy is not used...
This is the dlqDeliveryFailureCause  i can see in the error queue on a
message:
java.lang.Throwable: Exceeded redelivery policy limit:RedeliveryPolicy
{destination = null, collisionAvoidanceFactor = 0.15, maximumRedeliveries =
6, maximumRedeliveryDelay = -1, initialRedeliveryDelay = 1000,
useCollisionAvoidance = false, useExponentialBackOff = false,
backOffMultiplier = 5.0, redeliveryDelay = 1000}, cause:null

None of the redeliveryPolicy attribute is used.

Did i make any configuration mistake?

Clue : redeliveryPlugin is used. If i set "fallbackToDeadLetter" and
"sendToDlqIfMaxRetriesExceeded" to false, message in errors disappears (they
are not put into an error queue).

Thanks in advance

Clément




--
View this message in context: http://activemq.2283324.n4.nabble.com/activemq-xml-Embedded-Tomee-redeliveryDelay-tp4689728.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: activemq.xml Embedded Tomee redeliveryDelay

Posted by Gary Tully <ga...@gmail.com>.
Broker redelivery kicks in when the client redelivery attempts are
exceeded. The broker plugin intercepts the sendToDeadLetterQueue
broker method.

I think you will need to disable the default redelivery policy on your
clietns if you want < 6 attempts. Set
jms.redeliveryPolicy.maximumRedeliveryDelay=0 on your broker url so
that on the first rollback, the message will get send to the dlq and
intercepted by the redelivery plugin, which will then apply the
policy.

Peek at some of the tests: org.apache.activemq.broker.BrokerRedeliveryTest


On 13 January 2015 at 08:15, joeleclems <jo...@free.fr> wrote:
> No idea? Does someone use a redelivery policy and can send his configuration?
>
> Thanks
>
> Clément
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/activemq-xml-Embedded-Tomee-redeliveryDelay-tp4689728p4689836.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: activemq.xml Embedded Tomee redeliveryDelay

Posted by joeleclems <jo...@free.fr>.
No idea? Does someone use a redelivery policy and can send his configuration?

Thanks

Clément



--
View this message in context: http://activemq.2283324.n4.nabble.com/activemq-xml-Embedded-Tomee-redeliveryDelay-tp4689728p4689836.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.