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?

2 Answers 2

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.

Sign up to request clarification or add additional context in comments.

Comments

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.