JMX on a cluster

The Java Management Extensions (JMX) is a very useful and relatively unknown framework. It provides features for systems management and monitoring of Java applications. The JMX 2.0 JCP specification has hit a new milestone at the end of last year. The new specification contains a host of improvements, see this blog of the JMX spec lead for more information.

To me, the cascading/federation features are the most interesting additions. Enterprise applications usually act in a cluster setup using multiple VMs. Using the cascading/federation features you can group this vms and manage them as a single unit in a JMX client. This is very powerful, not only for monitoring tools, but also management actions triggered inside the application that should be invoked across the cluster (for instance, clearing the caches). Some platforms like IBM WebSphere provide good support for these scenario's, but are not standard API, hence harder to learn and to port.

This new JMX standard should be available in Java 7. If you can't wait that long and you do not work on a platform that supports a custom notion of clustered JMX, you could give OpenDMK a try. This is a JMX platform library that adds clustering support. It also provides SNMP support, which can be interesting for monitoring purposes. If you don't know about JMX, spend some time playing with JConsole, the management console for Java 5/6 based on JMX. This provides a lot of useful information and is a powerful tool, even if you do not do anything with JMX yourself.