Sachin Handiekar

Sachin Handiekar


December 2011
M T W T F S S
« Nov   Jan »
 1234
567891011
12131415161718
19202122232425
262728293031  

Categories


Get ActiveMQ Queue Size using MBean (Spring JMX)

Sachin HandiekarSachin Handiekar
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

Comments 4
  • liminescence
    Posted on

    liminescence liminescence

    Reply Author

    Hi Sachin. Thanks for the posting. I tried it your code, but getting some exception connecting to the broker.

    I 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&quot; useJmx="true" brokerName="localhost"

    Thanks!


  • Sachin Handiekar
    Posted on

    Sachin Handiekar Sachin Handiekar

    Reply Author

    There was no change except the useJmx="true" setting.

    Can you post the exception you'r getting…


  • Poyan Gerami
    Posted on

    Poyan Gerami Poyan Gerami

    Reply Author

    I get java.net.ConnectException: Connection refused , any settings I need for authentication ?


  • Mehmet Kirazoglu
    Posted on

    Mehmet Kirazoglu Mehmet Kirazoglu

    Reply Author

    Have to set VM arguments as below in order to connect JMX, you may state this as well:

    -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


Leave a Reply