Uploaded image for project: 'ActiveMQ Classic'
  1. ActiveMQ Classic
  2. AMQ-6042

In ActiveMQMessageConsumer, always set rollback cause

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 5.13.0
    • Broker
    • None

    Description

      In ActiveMQMessageConsumer, currently the rollback cause is only set for the case auto- or individual-acks. However, it should also be set for the other cases, so that in the rollback() method it can be picked up when creating the poison ack.

          if (isAutoAcknowledgeBatch() || isAutoAcknowledgeEach() || session.isIndividualAcknowledge()) {
              // schedual redelivery and possible dlq processing
              md.setRollbackCause(e);
              rollback();
          } else {
              // Transacted or Client ack: Deliver the next message.
              afterMessageIsConsumed(md, false);
          }
      

      I'd suggest to move md.setRollbackCause(e); to before the if().

      Attachments

        1. MessageListenerRedeliveryTest.java
          14 kB
          Martin Lichtin

        Issue Links

          Activity

            People

              Unassigned Unassigned
              lichtin Martin Lichtin
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: