Jetty has long had a rich set of JMX mbeans that give very detailed status, configuration and control over the server and applications, which can now simply be accessed with the JMiniX web console:
The usability of JMX has been somewhat let down due to a lack of quality JMX management consoles. JConsole and JVirtualVM do give good access to MBeans, but they rely on a RMI connection which can be tricky to setup to a remote machine. JMiniX avoids the RMI by allowing access to the MBeans via a servlet you can add to your webapplication.
The instructions were straight forward to follow and the steps were simply:
- Add dependency to your pom
- Add a repository to your pom (bummer – needs restlet.org which is not in maven central – if it was I’d consider adding JMiniX to our released test webapp)
- Define the servlet in your web.xml
- Build and run!
You can see by the screen shot above that the console gives a nice rendering of the available mbeans from the JVM and Jetty (and cometd if running). Attributes can be viewed and updated, and operations can be called – all the normal stuff. It only gives direct mbean access and does not provide any higher level management functions, but this is not a big problem if the mbeans are well designed and self documented.
Also if you wanted to develop more advanced management functions, then the restful nature of JMiniX should make this fairly straight forward. For example attributes can be retrieved with simple requests like:
http://localhost:8080/jmx/servers/0/domains/org.eclipse.jetty.server/ mbeans/type=server,id=0/attributes/startupTime/
That returns JSON like:
{"value":"1339059648877","label":"startupTime"}
JMiniX looks like a great tool to improve the management of your servers and applications and to leverage the value already built into the Jetty JMX mbeans.
We had been working on a similar effort for restful access to JMX, but JMiniX is more advanced. It does lack some of the features that we had been working on like aggregate access to repeated attributes, but considering the state of JMiniX, we may consider contributing those features to that project instead.
2 Comments
SRG · 07/06/2012 at 09:31
I’m too using JMinix right now, but i’m looking ahead Jolokia ( http://www.jolokia.org/ ), which provides a nice and clean REST publication of JMX beans.
Sadly there is no real Jolokia dashboard at this time.
This post about charts integration / jolokia is quite interesting (works very well), even if it’s not a JMX browser (just a JMX visualization mechanism).
http://nurkiewicz.blogspot.fr/2011/03/jolokia-highcharts-jmx-for-human-beings.html
I would really unify all my REST JMX access through Jolokia in the end, JMinix seems less easily expandable.
Rajiv · 14/06/2012 at 07:47
This is amazing, accessing JMX information in browser is quite convenient. we earlier used MX4j, which also allows you to publish JXM interface via browser. Jetty would be more useful with this addition.
Comments are closed.