Uploaded image for project: 'AMQ Broker'
  1. AMQ Broker
  2. ENTMQBR-9152

Broker Connector Should Look at Either the Message Address or the Link Target When Forwarding Messages

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • AMQ 7.12.0.GA
    • amqp-protocol, broker-core
    • None
    • False
    • None
    • False
    • Hide

      Manually set the message address in clients that do not automatically set it (proton python, proton C)

      Show
      Manually set the message address in clients that do not automatically set it (proton python, proton C)
    • Hide

      1. Deploy 2 brokers
      2. Configure the "target" broker with a receiver connector to pull messages from the "source" broker:

            <broker-connections>
               <amqp-connection uri="tcp://node2.test.redhat.com:5673" name="receiver-connection" retry-interval="100" reconnect-attempts="-1" user="admin" password="admin">
                  <receiver address-match="examples"/>
               </amqp-connection>
            </broker-connections>
      

      3. Use a client like the one at https://qpid.apache.org/releases/qpid-proton-0.39.0/proton/python/examples/simple_send.py to send a message to a queue on the source broker
      4. Messages go immediately to the DLQ instead of routing to the target broker.
      5. Modify the client to set a message address before sending:

          def on_sendable(self, event):
              while event.sender.credit and self.sent < self.total:
                  msg = Message(id=(self.sent + 1), body={'sequence': (self.sent + 1)})
                  msg.address = 'exampleQueue'
                  event.sender.send(msg)
                  self.sent += 1
      

      6. Now the forwarding succeeds

      Show
      1. Deploy 2 brokers 2. Configure the "target" broker with a receiver connector to pull messages from the "source" broker: <broker-connections> <amqp-connection uri="tcp://node2.test.redhat.com:5673" name="receiver-connection" retry-interval="100" reconnect-attempts="-1" user="admin" password="admin"> <receiver address-match="examples"/> </amqp-connection> </broker-connections> 3. Use a client like the one at https://qpid.apache.org/releases/qpid-proton-0.39.0/proton/python/examples/simple_send.py to send a message to a queue on the source broker 4. Messages go immediately to the DLQ instead of routing to the target broker. 5. Modify the client to set a message address before sending: def on_sendable(self, event): while event.sender.credit and self.sent < self.total: msg = Message(id=(self.sent + 1), body={'sequence': (self.sent + 1)}) msg.address = 'exampleQueue' event.sender.send(msg) self.sent += 1 6. Now the forwarding succeeds
    • Moderate

      The broker connector fails to forward messages and instead routes them to the DLQ when the address is not set at the message level. Scenarios without forwarding work fine, but when a receiver broker link is defined:

            <broker-connections>
               <amqp-connection uri="tcp://node2.test.redhat.com:5673" name="receiver-connection" retry-interval="100" reconnect-attempts="-1" user="admin" password="admin">
                  <receiver address-match="examples"/>
               </amqp-connection>
            </broker-connections>
      

      messages deposited on the source broker without an address set at the message level fail to cross the connector and instead go into the DLQ. Trace logging indicates the cause:

      2024-05-29 10:31:43,686 TRACE [org.apache.activemq.artemis.protocol.amqp.proton.handler.ProtonHandler] Handling EventImpl{type=DELIVERY, context=DeliveryImpl [_tag=[5], _link=org.apache.qpid.proton.engine.impl.SenderImpl@30f99b77, _deliveryState=null, _settled=false, _remoteSettled=true, _remoteDeliveryState=Rejected{error=Error{condition=failed, description='Missing 'to' field for message sent to an anonymous producer', info=null}}, _flags=0, _defaultDeliveryState=null, _transportDelivery=org.apache.qpid.proton.engine.impl.TransportDelivery@57676221, _data Size=0, _complete=true, _updated=true, _done=true]} towards org.apache.activemq.artemis.protocol.amqp.proton.AMQPConnectionContext@3f00fbe7
      2024-05-29 10:31:43,687 WARN  [org.apache.activemq.artemis.core.server] AMQ222149: Sending message Reference[1339]:RELIABLE:AMQPStandardMessage( [durable=true, messageID=1339, address=exampleQueue, size=110, scanningStatus=SCANNED, applicationProperties={}, messageAnnotations={x-opt-jms-dest=0, x-opt-jms-msg-type=5}, properties=Properties{messageId=xxxxxxxxxx, userId=null, to='null', subject='null', replyTo='null', correlationId=null, contentType=null, contentEncoding=null, absoluteExpiryTime=null, creationTime=Wed May 29 10:31:43 UTC 2024, groupId='null', groupSequence=null, replyToGroupId='null'}, extraProperties = TypedProperties[_AMQ_AD=exampleQueue]] to Dead Letter Address DLQ from exampleQueue
      

      If the message address is not set, the connector should derive it from the source address or link target.

            rhn-support-tbish Tim Bish
            rhn-support-dhawkins Duane Hawkins
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: