I have a cluster of tomcats which consume messages from an ActiveMQ topic. Now, if one of the tomcat in the cluster goes down then i am guessing that number of consumers would go down by 1.
Now, i would like to detect that change using some callback or listener on that topic. Is that feasible ?
Will something like : Region.getDestinations(ActiveMQDestination) work ?
Advisory Message is what you need.
each time you got a message with this code this means you have consumer starting or stopping.
doc http://activemq.apache.org/advisory-message.html
example:
each time you got a message with this code this means you have Connection starting or stopping.