Getting a queue size of an ActiveMQ queue using MBean (Spring JMX).
Spring Config file
* A class using the MBeanServerConnection to fetch the attribute from the MBean
* Running the Queue Counter
Spring Config file
* A class using the MBeanServerConnection to fetch the attribute from the MBean
* Running the Queue Counter
Hi Sachin. Thanks for the posting. I tried it your code, but getting some exception connecting to the broker.
ReplyDeleteI was wondering if you do some configuration, other that adding useJmx="true" in your activemq.xml file.
I have this config:
<broker xmlns="http://activemq.apache.org/schema/core" useJmx="true" brokerName="localhost"
Thanks!
There was no change except the useJmx="true" setting.
ReplyDeleteCan you post the exception you'r getting...
I get java.net.ConnectException: Connection refused , any settings I need for authentication ?
ReplyDeleteHave to set VM arguments as below in order to connect JMX, you may state this as well:
ReplyDelete-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=1099
-Dcom.sun.management.jmxremote.local.only=false
-Dcom.sun.management.jmxremote.authenticate=false
-Djava.rmi.server.hostname=localhost
-Dcom.sun.management.jmxremote.ssl=false