Uploaded image for project: 'ActiveMQ Artemis'
  1. ActiveMQ Artemis
  2. ARTEMIS-2740

Broker sends messages from DLQ populated with illegal AMQP message annotations

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 2.11.0, 2.12.0
    • 2.13.0
    • AMQP
    • None

    Description

      When dispatching messages from the DLQ the broker is populating the message annotations with values which violate the AMQP specification regarding the symbolic keys that may be used.  Messages are populated with broker specific annotation values such as "_AMQ_ORIG_ADDRESS" which violates the key reservations made by the specification as shown below.

       

      3.2.10 Annotations - The annotations type is a map where the keys are restricted to be of type symbol or of type ulong. All ulong keys, and all symbolic keys except those beginning with "x-" are reserved. Keys beginning with "x-opt-" MUST be ignored if not understood. On receiving an annotation key which is not understood, and which does not begin with "x-opt", the receiving AMQP container MUST detach the link with a not-implemented error.

       

      The test added in ARTEMIS-2372 exposes this to some degree and with the below modification it becomes more apparent. 

       

      diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpExpiredMessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpExpiredMessageTest.java
      index 54458b2..b240b84 100644
      --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpExpiredMessageTest.java
      +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpExpiredMessageTest.java
      @@ -175,6 +175,8 @@
             Assert.assertNotNull(received);
             received.accept();
       
      +      assertEquals(getQueueName(), received.getMessageAnnotation("_AMQ_ORIG_ADDRESS"));
      +
             assertNotNull("Should have read message from DLQ", received);
             assertEquals(0, received.getTimeToLive());
             assertNotNull(received);
       

      Attachments

        Issue Links

          Activity

            People

              clebertsuconic Clebert Suconic
              tabish Timothy A. Bish
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: