4 Replies Latest reply: Feb 21, 2012 10:52 AM by stupormundi RSS

no success increasing number of redelivery attempts

stupormundi Newbie

In JBoss AS 5.1 , messaging 1.4.3 , I have a queue that I've attempted to make more resilient by changing the RedeliveryDelay and the DeliveryAttempts.

 

I've set the DefaultRedeliveryDelay on the ServerPeer to 10000 ms and that worked, so far so good.

 

I had initially set the DefaultMaxDeliveryAttempts (on the ServerPeer, for all my queues) to 10, but the number of redeliveries always appeared to be 5 or 6, in the log it would show:

 

Message redelivered=6 max=5 sending it to the dlq delegator->JBossMessage[2164239059637043

6]:PERSISTENT, deliveryId=13

 

I increased the DefaultMaxDeliveryAttempts on the ServerPeer to 20, but the number of actual redelivery attempts didn't increase.

 

I then tried to override this for the particular queue I was interested in to 30, like so:

 

<attribute name="MaxDeliveryAttempts">30</attribute>

 

... but the result was the same. I always checked the JMX console to be sure the settings had been picked up.

 

I've left the timeToLive on the MessageProducer on the default (0) and have also put in logging on it and on the produced messages to confirm that it is indeed 0.

 

Is there anything else that could cut down the number of redelivery attempts? .. After all, the queue attribute is called MaxRedeliveryAttempts and not RedeliveryAttempts ....

  • 1. Re: no success increasing number of redelivery attempts
    Yong Hao Gao Master

    If you are using MDB, did you try 'useDLQ=false'?

  • 2. Re: no success increasing number of redelivery attempts
    stupormundi Newbie

    Sorry for the late reponse, other tasks kept me from getting back to this piece of code

     

    I've now set useDLQ=false on the MDB, and indeed, now redelivery attempts aren't limited to 5. I get the impression that redelivery attempts now go on forever. In this particular case, that may be preferable to 'only 5 times', maybe. However, generally, infinite message redelivery attempts aren't always acceptable.

     

    What I would really want is that the config in messaging-service.xml , attribute "DefaultMaxDeliveryAttempts" , is respected (or some more fine-grained config, per queue or per MDB).

     

    I saw some reports which maybe indicate this is a known problem in AS 5. Can anyone confirm this?

  • 3. Re: no success increasing number of redelivery attempts
    Justin Bertram Master

    ...redelivery attempts aren't limited to 5. I get the impression that redelivery attempts now go on forever.

    Why do you get that impression?

    What I would really want is that the config in messaging-service.xml , attribute "DefaultMaxDeliveryAttempts" , is respected (or some more fine-grained config, per queue or per MDB).

    Now that your MDB is using useDLQ=false then JBoss Messaging will enforce the "DefaultMaxDeliveryAttempts" which is set in messaging-service.xml.  This setting can be overridden on a per-destination basis using the "MaxDeliveryAttempts" attribute.  Redelivery cannot be set on a per-MDB basis.

    I saw some reports which maybe indicate this is a known problem in AS 5. Can anyone confirm this?

    I haven't heard that.  To my knowledge the redelivery settings should be enforced without issue.

     

    To be clear, there has been confusion around the useDLQ and DefaultMaxDeliveryAttempts settings.  This is because JBoss MQ, the JMS implementation which preceded JBoss Messaging, did not have its own redelivery/DLQ logic.  Therefore, redelivery/DLQ logic was placed in the JBoss EAP generic JMS JCA Resource Adapter.  This logic is active by default and because it uses a lower threshold (i.e. 5) than JBoss Messaging (i.e. 10) that supersedes it.  To rectify this, one must set the activation configuration property named "useDLQ" to "false" (defaults to "true") on the MDB.  This will allow the JBoss Messaging configuration (i.e. DefaultMaxDeliveryAttempts) to take effect.  We currently recommend that every MDB set "useDLQ" to "false" so that the JBoss Messaging redelivery logic is used in lieu of the RA's logic.

  • 4. Re: no success increasing number of redelivery attempts
    stupormundi Newbie

    Sorry for causing confusion about this. My original testing must have been flawed.

     

    I've retested now and can confirm that the MaxDeliveryAttempts setting is respected.

     

    Thanks for the clarification!