1
votes

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:

  • Node A: 8201 messages
  • Node B: 8202 messages
  • Node C: 8201 messages

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

1

1 Answers

0
votes

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/