Search code examples
jmxactivemq-artemis

Apache Artemis listMessages MBean operation always returns nothing


I discovered MBeans recently and just checked out the ActiveMQ Artemis MBeans. Inside the queue attributes we see that there are some messages since the MessageCount is > 0.

enter image description here

But when I call the listMessages/AsJSON method the returned String is always empty:

enter image description here

Is there maybe I config I have missed? Other operations like listMessageCounter are working fine.


Solution

  • The issue is that the messages are "in delivery" which means that they will not be returned by the listMessages or listMessagesAsJSON methods. Notice that DeliveringCount is 16 (i.e. the same as Message Count). Messages which are in delivery are those messages which have been dispatched from the broker to a client but the client has not yet acknowledged.

    Try using listDeliveringMessages or listDeliveringMessagesAsJSON instead.