Friday, July 25, 2008

JMX - way to go

I knew next to nothing about JMX until recently, and then I had the opportunity to explore it. JMX can be used in building distributed application, building monitoring tools for applications.

With JMX lots of things get easier. I really do not intend to repeat the information which is available on internet and let me tell you, you will get plenty of good web-sites if you search on google. Instead I want to touch a few points which give good impression to a newbie who knows a little about JMX.

First of all, use of JMX is really easy. Starting with 1.5, JDK comes with JMX console Jconsole, which can be used to explore the mbeans (management beans, the beans which you register with mbean server).

To simplify matters further, there is Spring. Spring really makes it a lot easier to use JMX. A couple of configuration in xml and you are ready to see the JMX in action.

With JMX, you can see runtime information about your applications. You can expose the information through mbeans and can access them while your application is running, hence helps in monitoring.

Remember log4j, how it makes life so much easier. And remember when you face an issue in production environment and all you can do is, analyzing logs; but wait a minute, you realize that log levels are set to INFO or ERROR but you want to make them DEBUG. With log4j and JMX you can do this with a click of mouse.

You can go further to hook the JMX with snmp and let your existing snmp tool monitor your application with subagent talking to Mbean server.

Tomcat and many application servers also expose mbeans which you can use to know the insight of server.

I hope you felt a little excited about JMX. I do not intend to teach you JMX in this post, but if you wish, we can definitely discuss on this topic further.

No comments: