1

I'm using the UNIX commands that ActiveMQ provides for browsing the queues, and I'm trying to browse a particular queue, specifying a JMS selector. This is what I'm trying to do:

./activemq browse --amqurl tcp://host:port --msgsel "JMSMessageID='ID:XXXX'" QUEUE.FOO

Selecting by JMSMessageID, doesn't work.

Then, I would like to do some filtering by JMSText, matching any string. The problem here is that the messages are XML, and maybe I would need to handle the special chars.

./activemq browse --amqurl tcp://host:port --msgsel "JMSText='*<anyTag>SOMEVALUE</anyTag>*'" QUEUE.FOO

Has anyone did some filtering like that? having the messages matching any string?

Perimosh
  • 2,304
  • 3
  • 20
  • 38

2 Answers2

1

After a few hours of trying, finally found the format.

Should use double quote outside. Escape single quote inside.

To browse exact 1 message using message id:

./activemq browse --msgsel "JMSMessageID=\'ID:wilsonyipoffice-12345-1560070020263-6:3:1:1:2\'" queueName

To browse messages from same host:

./activemq browse --msgsel "messageID='wilsonyipoffice-12345-1560070020263-6'" queueName

Can also use in purge command.

Wilson Yip
  • 11
  • 2
0

According to this: https://github.com/apache/activemq/pull/104/commits/4fe17d080715ca712f39f796b6a43a722a3e1119

you have to use the escape: \" around the attribute name, i.e:

./activemq browse --amqurl tcp://host:port --msgsel \"JMSMessageID='ID:XXXX'\" QUEUE.FOO

with wildcard im still getting errors though.

poozmak
  • 414
  • 2
  • 11