But! We're using a separate JVM to host ActiveMQ for all JBoss instances on the host machine. WHY? Because REASONS.
Configuring ActiveMQ
This part is super duper simple,
Part the first.
AUTHENTICATION.
Don't be a dummy, setup a proper read only account for your monitoring activities in the ActiveMQ jmx password and user file (Yes its a flat file, but its better than nothing, and java keystores are the worst).
Add a line to $ACTIVEMQ_HOME/conf/jmx.access eg:
rhq readonly
this creates a user called rhq, with read only access to jmx functions
Add a line to $ACTIVEMQ_HOME/conf/jmx.password eg:
rhq 2AZE8Dz+DttM<fL?
YOU ALWAYS USE SECURE PASSWORDS RIGHT?
TELLING THE CONTAINER TO ENABLE JMX
Edit the $ACTIVEMQ_HOME/conf/activemq.xml file
Find the <broker> element, and add useJmx="true"> Eg:
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" useJmx="true">
Next, find the <managementContext> stanza. enable the create connector attrib, and define a connector port. eg:
<managementContext createConnector="true" connectorPort="1099" />
If you're using RMI through a firewall, you should also add a rmiServerPort="something" attrib on a port which your ActiveMQ instance can communicate back to your JMX client. (Eg, when using jconsole or something to debug a remote activemq)
Thats.. it! Restart your ActiveMQ instance bin/activemq restart
Documentation here
Part The Second.
Connecting your RHQ agent to your JMX endpoint.
- Open your RHQ web console, and browse to the platform which is hosting your ActiveMQ instance.
- Select the inventory tab for the platform (not the inventory tab for the whole RHQ system)
- On the child resources sub tab, click the Import fly away (fly up in this case?) and select JMX Server
- Select JDK 5 from the connection settings template dropdown.
- on the deployment options page, set the Connector Address field to: service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi
- in the principal field, enter rhq (this is the read only activemq user defined in the first part)
- in the credentials field, enter your super secure password
- Click finish.
Wait as your RHQ agent now evaluates the available mbeans and makes them available for viewing in RHQ. You now can monitor the JVM health of your ActiveMQ instance.
Coming up in Part2, how to actually monitor the specific ActiveMQ Beans