I try to get a single message from Artemis through Jolokia JMX but can't find a way to filter for JMSMessageID
.
Broker version: Red Hat AMQ 7.11.7
My best attempt is currently:
https://broker/console/jolokia/exec/org.apache.activemq.artemis:broker=!%22amq-broker!%22,component=addresses,address=!%22ExpiryQueue!%22,subcomponent=queues,routing-type=!%22anycast!%22,queue=!%22ExpiryQueue!%22/browse(java.lang.String)/JMSmessageID=!%2215232235223!%22
It calls the browse(String filter)
method on QueueControl
, with the argument JMSmessageID="15232235223"
but the filter does not work. When I execute this request, I just get all messages of the queue.
When I left out the double quotes around the message ID, I get no results.
I read in another answer that filtering for message headers is not possible (only for properties), which sounds weird.
However, any suggestions how to get a single message by message ID? Thanks
There's a few things to keep in mind here...
JMSMessageID
should suffice for that. This is represented as "user ID" in the web console.JMSMessageID
in a query would work if you were using a JMS client. However, the ActiveMQ Artemis web console doesn't use a JMS client when browsing messages. It simply uses the Core API. Therefore, you need to use a core filter expression, namely AMQUserID
.JMSMmessageID
requires starting with ID:
as noted in the JavaDoc."
). You should use single quotes (i.e. '
) instead. As noted in the relevant JavaDoc:
A string literal is enclosed in single quotes...
Putting this all together...Something like this should work for you:
https://broker/console/jolokia/exec/org.apache.activemq.artemis:broker=!%22amq-broker!%22,component=addresses,address=!%22ExpiryQueue!%22,subcomponent=queues,routing-type=!%22anycast!%22,queue=!%22ExpiryQueue!%22/browse(java.lang.String)/AMQUserID='ID:8dfdf33e-bc84-11ef-9ea4-3ce1a1d12939'