RESTFul JMX: Open Java Management
GoalOne of my goals in last job was:
Allow third party systems and user access, in easy way, to JMX MBeans provided by our Enterprise application
The common solution was to use "JMX Remoting" (JSR160) and than, i had to choose:
- A "JMX remoting" protocol
- A "JMX viewer" compliant with such protocol
Choosing a JXM Remoting protocolI found several supported protocols such as rmi, iiop, jmxmp, soap provided by the MX4J project which last release has been in 2006.
Lately, JBoss community, has released a remoting-jmx, a project to provide the integration required to expose JMX over Remoting 3 connections.
Chooosing a JMX ViewerConcerning JMX Viewer the most popular are JConsole and VisualVM both are monitoring tool provided by JDK, while if we need web-based solution, we have to catch from open source marketplace (see http://java-source.net/open-source/jmx)
After investigationAfter this investigation I understood that I would have been kept busy a while, to do technical evaluation and test of all the possibilities and my thought was:
"Also if JMX is the natural way to have access to technical monitoring & management, it lacks a lightweight tool to expose mbeans and to browse them securely on any application and environment without heavy infrastructure setup."
The last searchBefore starting this activity I launched a last search with the keywords: "JSON + JMX" and i found out the solution of my problem. Two names came out that have caught my attention JOLOKIA & JMINIX.
Jolokia is a JMX-HTTP bridge giving an alternative to JSR-160 connectors. It is an agent based approach with support for many platforms. In addition to basic JMX operations it enhances JMX remoting with unique features like bulk requests and fine grained security policies.
Don't want to use an external full-blown JMX console? Just want to have a simple JMX entry point into your new or existing apps? If the answer is yes, JMiniX is your solution
Both of them allow to access to MBean(s) in RESTFul way (HTTP+REST+JSON) but, in addition, JMiniX offers also a built-in web console (see fig. below)
ConclusionJolokia looks like more a complete framework ready for enterprise solution and offer a wide range of solution, while JMiniX is less ambitious but very easy to deploy,configure and use.
Finally, i've proposed to use JMiniX especially for the availability of a web console and i've deployed it as an independent web app (ie agent) in order to have a complete solution "out-of-box"
if you have interest in technical monitoring & management of your Java application, take a look of these projects because, as stated in post's title, they open the Java management making its use more simple & powerful
 In the Java programming language, an MBean (managed bean) is a Java object that represents a manageable resource, such as an application, a service, a component, or a device.