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

OpenWire support: selectors don't match on JMSMessageID

XMLWordPrintable

    • False
    • None
    • False
    • Hide

      This description uses my general-purpose test client, which is available from here:

      https://github.com/kevinboone/amqutil

      However, it should be possible to reproduce using a few lines of Java.

      1. Start AMQ 7 broker instance.

      2. Produce some messages to the broker:

      $ amqutil produce 100 --destination TEST.FOO 

      3. Retrieve a message, to check the message ID format:

      $ amqutil consume --destination TEST.FOO
      ID:fedora-45435-1659361941138-1:1:1:1:1 TextMessage 

      4. Try to retrieve a message using a selector that ought to match:

      $ amqutil consume --destination TEST.FOO --selector "JMSMessageID like '%fedora%'" 

      Note that "fedora" is my hostname – the message ID format will be different on other sytems.

      With the selector, no messages are retrieved. Selectors based on ordinary JMS message headers work fine – it's just the message ID that's shows a problem.

      The same process works fine with ActiveMQ – selectors match on JMSMessageID just fine. It also works on AMQ 7 using AMQP ("–qpid") or Artemis core ("–artemis") protocols, although the formats of the message ID are different in each case (which might be the source of the problem).

      Show
      This description uses my general-purpose test client, which is available from here: https://github.com/kevinboone/amqutil However, it should be possible to reproduce using a few lines of Java. 1. Start AMQ 7 broker instance. 2. Produce some messages to the broker: $ amqutil produce 100 --destination TEST.FOO 3. Retrieve a message, to check the message ID format: $ amqutil consume --destination TEST.FOO ID:fedora-45435-1659361941138-1:1:1:1:1 TextMessage 4. Try to retrieve a message using a selector that ought to match: $ amqutil consume --destination TEST.FOO --selector "JMSMessageID like '%fedora%' " Note that "fedora" is my hostname – the message ID format will be different on other sytems. With the selector, no messages are retrieved. Selectors based on ordinary JMS message headers work fine – it's just the message ID that's shows a problem. The same process works fine with ActiveMQ – selectors match on JMSMessageID just fine. It also works on AMQ 7 using AMQP ("–qpid") or Artemis core ("–artemis") protocols, although the formats of the message ID are different in each case (which might be the source of the problem).

      The JMS API allows for selectors to be applied to the JMS message ID, using a selector of this form:

      JMSMessageID like '%something%' 

      When using AMQ 7 with an OpenWire client, selectors of this form match no messages. This worked in AMQ 6, and works on AMQ 7 with protocols other than OpenWire.

              rhn-support-jbertram Justin Bertram
              rhn-support-kboone Kevin Boone
              Michal Toth Michal Toth
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: