Christian Posta bio photo

Christian Posta

Field CTO at solo.io, author Istio in Action and Microservices for Java Developers, open-source enthusiast, cloud application development, committer @ Apache, Serverless, Cloud, Integration, Kubernetes, Docker, Istio, Envoy #blogger

Twitter Google+ LinkedIn Github Stackoverflow

HawtIO is a new pluggable HTML5 dashboard for monitoring ActiveMQ, Camel, Karaf, Fuse Fabric, Tomcat, and other technologies. Actually, I was completely surprised to see the list of plugins already available and how HawtIO has already gained so much good traction. Not surprisingly though... it does some pretty cool stuff...

The purpose of this quick post is to help you plug HawtIO into your stand-alone ActiveMQ instances with minimal fuss. For production deployments, I would recommend using a hardened, production-ready version of ActiveMQ such as FuseMQ Enterprise, but some folks stick with the community versions and a standalone deployment. Let's say you had the latest version of ActiveMQ and wanted to pop HawtIO into it to see how "hawt" it is.

First, HawtIO is a webapp packaged as a normal war file that can be deployed to any servlet container. This means you can deploy it, for example, to a Tomcat instance which has an embedded ActiveMQ along with some Camel routes, and HawtIO would discover and allow you to monitor all three technologies from the same dashboard. But like I said before, this post is more about the stand-alone deployments. The stand-alone ActiveMQ itself doesn't run in a servlet container, but does contain an embedded Jetty server that it uses for its current web console. Basically, what we want to do is tell the embedded Jetty server to find the HawtIO war and load it up.

Start by downloading the HawtIO war and put it at your $ACTIVEMQ_HOME/hawtio folder (that folder won't exist out of the box, you'll have to create it).

Then edit the Jetty config file in $ACTIVEMQ_HOME/conf/jetty.xml

You'll want to add the following WebAppContext to the handlers property:

[xml]
<bean id="securityHandler" class="org.eclipse.jetty.security.ConstraintSecurityHandler">
...
<property name="handler">
<bean id="sec" class="org.eclipse.jetty.server.handler.HandlerCollection">
<property name="handlers">
<list>
...
<bean class="org.eclipse.jetty.webapp.WebAppContext">
<property name="contextPath" value="/hawtio" />
<property name="war" value="${activemq.home}/hawtio/hawtio-default-1.1.war" />
<property name="logUrlOnStart" value="true" />
</bean>
[/xml]

Next, we'll need to tweak the contents of the hawtio war file because it will contain a conflicting slf4j jar that would normally already be on the classpath for ActiveMQ:

zip -d $ACTIVEMQ_HOME/hawtio/hawtio-web-1.0.war WEB-INF/lib/slf4j-api-1.6.1.jar

After that you should be good to go. Start ActiveMQ and Navigate your browser to http://localhost:8161/hawtio/

Then have fun hacking around!

Updated to use latest release, hawtio 1.1!

No need to do the extra step of modifying the contents of the WAR file. Just point to the WAR file in your jetty.xml config file, and you're off!