## Monitoring the Broker

### Overview

You can use any Java Management Extensions (JMX)-compliant console, such as JConsole or MC4J to monitor the messages passed between the producer, the broker, and the consumer.

### Using JConsole

To monitor the messages using JConsole:

1. Ensure that the `JAVA_HOME` environment is set.

2. From a command prompt, run jconsole.

3. In the JConsole window, click the Advanced tab.

4. Enter the following into the JMX URL field.

   `service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi`

5. Click Connect.

   Figure 4.1. The Advanced Tab in JConsole

6. Click the MBeans tab.

7. Under the Tree node in the MBeans panel, expand org.apache.activemq localhost Queue.

8. Open TEST.FOO and in the Attributes tab, check that the messages have been sent to the queue.

   Figure 4.2. Queue Attributes in JConsole