What is the behaviour of max-delivery-attempts attribute if it is set to 0 in JBM and in HornetQ?

Solution Unverified - Updated -

Issue

  • What is the behaviour of max-delivery-attempts attribute if it is set to 0 in JBM and in HornetQ?

  • When max-delivery-attempts is set to 0 in JBM, it immediately send message to DLQ.

    <mbean xmbean-dd="xmdesc/Queue-xmbean.xml" name="jboss.messaging.destination:service=Queue,name=TestQueue" code="org.jboss.jms.server.destination.QueueService">
    <!-- Defining the DLQ for this TestQueue -->
        <attribute name="DLQ"> jboss.messaging.destination:name=DLQ,service=Queue</attribute>
        <attribute name="JNDIName">TestQueue</attribute>
    <!-- The number of times, undilivered messages would be resend -->
    <attribute name="MaxDeliveryAttempts">0</attribute>
        <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
        <depends>jboss.messaging:service=PostOffice</depends>
    </mbean>

However with HornetQ if max-delivery-attempts is set to 0, it send message infinite times to client and never send message to DLQ.

<address-setting match="jms.queue.TestQueue">
         <dead-letter-address>jms.queue.DLQ</dead-letter-address>
         <max-delivery-attempts>0</max-delivery-attempts>
         <expiry-address></expiry-address>
         <redelivery-delay>100</redelivery-delay>
         <max-size-bytes>104857600</max-size-bytes>       
         <page-size-bytes>10485760</page-size-bytes>
         <message-counter-history-day-limit>10</message-counter-history-day-limit>
         <address-full-policy>PAGE</address-full-policy>
         <redistribution-delay>6000</redistribution-delay>
</address-setting>

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 5.x with JBoss JBoss Messaging and HornetQ
    • 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.