Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I turn on JMX in ActiveMQ 5.2

Tags:

activemq

Whats the proper way to enable JMX in ActiveMQ 5.2? I've seen conflicting documents, so I was wondering if anyone out there knows what the proper config file change should be. I think I might have it working by changing the batch file I use to start ActiveMQ, but I don't really know.

like image 755
Jonathan Beerhalter Avatar asked Nov 12 '09 00:11

Jonathan Beerhalter


People also ask

How to disable JMX in ActiveMQ?

To disable JMX entirely you simply set the broker element's useJmx attribute to false . This will stop the broker from exposing itself via JMX. Disabling JMX will also disable the commands in the activemq shell.

How do I monitor my ActiveMQ connection?

You can monitor the status of the connection with the broker via the addTransportListener() method on the ActiveMQConnection. This method takes a TransportListener which is notified as the connection is established & dropped.

What is Apache JMX?

The JMX protocol allows remote monitoring and managing of Apache Tomcat. For more information, refer to Apache Tomcat Monitoring and Managing Tomcat. Which type of configuration should be used? If the Apache Tomcat instance is used for sandbox or test purposes, you can use the no authentication option.


2 Answers

<!-- Use the following to configure how ActiveMQ is exposed in JMX -->
<managementContext>
  <managementContext createConnector="true" />
</managementContext>

Put this inside the bean of your broker in the activemq.xml file and it should do the trick. Your connector will be created in localhost:1099, and you shouldn't need to modify the batch file. Regards, Seb

like image 56
srodriguez Avatar answered Sep 24 '22 02:09

srodriguez


with a default installation, just edit your /bin/activemq file and setup the ACTIVEMQ_SUNJMX_START property as follows...

ACTIVEMQ_SUNJMX_START="-Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"

like image 32
Ben ODay Avatar answered Sep 24 '22 02:09

Ben ODay