0

I have to get (not consume) part of a message that is in queue. I reused bash script that was prompted as a response here, with the use of /api/jolokia/ : ActiveMQ Jolokia API How can I get the full Message Body

Part of a response that I am interested to get is MsgId in value:text :

"request": {
    "mbean": "org.apache.activemq:brokerName=MyBrokerName,destinationName=MyQueueName,destinationType=Queue,type=Broker",
    "type": "exec",
    "operation": "browseMessages()"
},
"value": [
    {
        "jMSCorrelationIDAsBytes": [],
        ***some other objects here ***
        "text": "<?xml version=\"1.0\"?>\r\n<RepositoryOperationRq xmlns=\"http://www.ACORD.org/\">\r\n  <MsgId>xxx28bab-e62c-4dbc-a2aa-xxx</MsgId>\r\n  <CreationDtTime>2020-01-01T11:11:11-11:00</CreationDtTime>\r\n 
        
        

There is no problem on DEV env ActiveMQ but when I tried do the same on UAT env ActiveMQ there is no value:text object in response at all, and some others objects values are different, like:

"connectionControl": false

and

"connectionControl": "false"

I thought it might be because of maxDepth parameter so I increased it. Unfortunately when set maxDepth=5 I got that error:

"error_type": "java.lang.IllegalStateException",
"error": "java.lang.IllegalStateException : Error while extracting next from org.apache.activemq.broker.region.cursors.FilePendingMessageCursor@3bb9ace4",
"status": 500

and the whole ActiveMQ stopped receiving any messages- had to force restart it. ActiveMQ configs should be the same on both envs, and the version is 5.13.3. Do you know why that text object is missing?

Kuba
  • 1
  • 1
  • Yes, thanks for your comments. You are probably right about that the message content may be different, unfortunately I cannot make any changes to message content itself, it is external incoming soap message. – Kuba Sep 15 '21 at 12:24
  • If my answer addressed your question please mark it as correct to help other users who have the same question in the future. Thanks! – Justin Bertram Mar 11 '22 at 17:59

1 Answers1

0

I think the difference here is down to the content of the messages in each environment. The browseMessages operation simply returns the messages in the corresponding destination (e.g. MyQueueName).

If the message is not a javax.jms.TextMessage then it won't have the text field. If a property is false instead of "false" that just means the property value was a boolean instead of a String respectively.

Justin Bertram
  • 29,372
  • 4
  • 21
  • 43