jbossjmshornetqjboss-eap-6jboss-mdb

How to obtain number of messages in clustered queue in JBoss EAP6/HornetQ


I am trying to count messages in HornetQ clustered queue on JBoss EAP 6.4 (domain mode)

Obtaining number of messages in particular HornetQ instance is not an problem (here is the way I do it), but what I am actually want, is to get cumulative/total number of messages of given queue in whole cluster.

Right now when I send to given queue 24604 messages, they are being nicely distributed to 3 nodes:

Is there a way to count all messages of given queue in a cluster?


Solution

  • I have finally found a solution to obtain total number of messages in cluster by invoking broadcast ejb call on all cluster members, where each cluster member gets number of messages from InVm jms sender.

    I have described it here:

    1. http://jeefix.com/how-to-invoke-broadcast-ejb-at-all-jboss-eap6-ejb-cluster-members/
    2. http://jeefix.com/managing-hornetq-queues-via-jms-api/