Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-4945

Messages transfered from DLQ to working queue will never be resent to DLQ

    XMLWordPrintable

    Details

    • Workaround:
      Workaround Exists
    • Workaround Description:
      Hide

      There is a simple workaround which is to use a new message to transfer from the DLQ to the working queue. That is, a new message is created from the contents of the message pulled from the DLQ and this new message is sent to the working queue.

      Show
      There is a simple workaround which is to use a new message to transfer from the DLQ to the working queue. That is, a new message is created from the contents of the message pulled from the DLQ and this new message is sent to the working queue.

      Description

      Messages that are retreived from the DLQ have their JMSXDeliveryCount set to 1. Inside org.jboss.ejb.plugins.jms.DLQHander, this leads to the code that redirects failed messages to the DLQ. Starting on line 454, the count gets set to 1, then is decremented to zero. On the next redelivery, the same thing happens again. The JMS_JBOSS_REDELIVERY_COUNT is incremented on each cylce but never gets checked:

      try

      { if (msg.propertyExists(PROPERTY_DELIVERY_COUNT)) // Is 1 for a message transferred from DLQ <<<< count = msg.getIntProperty(PROPERTY_DELIVERY_COUNT); }

      catch (JMSException ignored)
      {
      }
      if (count > 0)

      { // The delivery count is one too many --count; // Becomes zero for message transferred from DLQ <<< }

      else if (msg.propertyExists(JMS_JBOSS_REDELIVERY_COUNT))
      count = msg.getIntProperty(JMS_JBOSS_REDELIVERY_COUNT);
      else
      {
      id = msg.getJMSMessageID();
      if (id == null)

      { // if we can't get the id we are basically f**ked log.error("Message id is null, can't handle message"); return false; }

      count = incrementResentCount(id);
      fromMessage = false;
      }

      if (count > max) // Count is always zero for a message that has been transfered from DLQ <<<<

      { id = msg.getJMSMessageID(); log.warn("Message resent too many times; sending it to DLQ; message id=" + id); sendMessage(msg); deleteFromBuffer(id); handled = true; }

      Cheers,
      Mike C.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  adrian.brock Adrian Brock
                  Reporter:
                  miclark Mike Clark
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: