DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
  1. DZone
  2. Software Design and Architecture
  3. Cloud Architecture
  4. Plugging the HawtIO Monitoring Webapp into a Stand-Alone ActiveMQ Instance

Plugging the HawtIO Monitoring Webapp into a Stand-Alone ActiveMQ Instance

Christian Posta user avatar by
Christian Posta
·
Apr. 23, 13 · Tutorial
Like (1)
Save
Tweet
Share
8.85K Views

Join the DZone community and get the full member experience.

Join For Free

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:

<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-web-1.0.war" />
                            <property name="logUrlOnStart" value="true" >
                        </bean></p>

<p>

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!




WAR (file format) Jetty (web server) Apache Tomcat Container POST (HTTP) Dashboard (Mac OS) Console (video game CLI) Classpath (Java)

Published at DZone with permission of Christian Posta, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • A Beginner's Guide to Infrastructure as Code
  • Create a CLI Chatbot With the ChatGPT API and Node.js
  • How To Select Multiple Checkboxes in Selenium WebDriver Using Java
  • Integrate AWS Secrets Manager in Spring Boot Application

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: