Questo contenuto non è disponibile nella lingua selezionata.

Chapter 2. Installing HawtIO


There are several options to start using the HawtIO console:

2.1. Adding Red Hat repositories to Maven

To access artifacts that are in Red Hat Maven repositories, you need to add those repositories to Maven’s settings.xml file. Maven looks for the settings.xml file in the .m2 directory of the user’s home directory. If there is not a user specified settings.xml file, Maven uses the system-level settings.xml file at M2_HOME/conf/settings.xml.

Prerequisite:

You know the location of the settings.xml file in which you want to add the Red Hat repositories.

Procedure:

  1. In the settings.xml file, add repository elements for the Red Hat repositories as shown in this example:

    <?xml version="1.0"?>
    <settings>
    
      <profiles>
        <profile>
          <id>extra-repos</id>
          <activation>
            <activeByDefault>true</activeByDefault>
          </activation>
          <repositories>
           <repository>
             <id>redhat-ga-repository</id>
             <url>https://maven.repository.redhat.com/ga</url>
             <releases>
               <enabled>true</enabled>
             </releases>
             <snapshots>
               <enabled>false</enabled>
             </snapshots>
            </repository>
            <repository>
              <id>redhat-ea-repository</id>
              <url>https://maven.repository.redhat.com/earlyaccess/all</url>
              <releases>
                <enabled>true</enabled>
              </releases>
              <snapshots>
                <enabled>false</enabled>
              </snapshots>
            </repository>
          </repositories>
          <pluginRepositories>
            <pluginRepository>
              <id>redhat-ga-repository</id>
              <url>https://maven.repository.redhat.com/ga</url>
              <releases>
                <enabled>true</enabled>
              </releases>
              <snapshots>
                <enabled>false</enabled>
              </snapshots>
            </pluginRepository>
            <pluginRepository>
              <id>redhat-ea-repository</id>
              <url>https://maven.repository.redhat.com/earlyaccess/all</url>
              <releases>
                <enabled>true</enabled>
              </releases>
              <snapshots>
                <enabled>false</enabled>
              </snapshots>
            </pluginRepository>
          </pluginRepositories>
        </profile>
      </profiles>
    
      <activeProfiles>
        <activeProfile>extra-repos</activeProfile>
      </activeProfiles>
    
    </settings>
    Copy to Clipboard Toggle word wrap

2.2. Running from CLI (JBang)

You can install and run HawtIO from CLI using JBang.

Note

If you don’t have JBang locally yet, first install it: https://www.jbang.dev/download/

Procedure:

  1. Install the latest HawtIO on your machine using the jbang command:

    $ jbang app install -Dhawtio.jbang.version=4.0.0.redhat-00040 hawtio@hawtio/hawtio
    Copy to Clipboard Toggle word wrap
    Note

    This installation method is available only with jbang>=0.115.0.

  2. It will install the HawtIO command. Launch a HawtIO instance with the following command:

    $ hawtio
    Copy to Clipboard Toggle word wrap
  3. The command will automatically open the console at http://0.0.0.0:8080/hawtio/. To change the port number, run the following command:

    $ hawtio --port 8090
    Copy to Clipboard Toggle word wrap
  4. For more information on the configuration options of the CLI, run the following code:

    $ hawtio --help
    Usage: hawtio [-hjoV] [-c=<contextPath>] [-d=<plugins>] [-e=<extraClassPath>]
                  [-H=<host>] [-k=<keyStore>] [-l=<warLocation>] [-p=<port>]
                  [-s=<keyStorePass>] [-w=<war>]
    Run Hawtio
      -c, --context-path=<contextPath>
                          Context path.
      -d, --plugins-dir=<plugins>
                          Directory to search for .war files to install as 3rd
                            party plugins.
      -e, --extra-class-path=<extraClassPath>
                          Extra class path.
      -h, --help          Print usage help and exit.
      -H, --host=<host>   Hostname to listen to.
      -j, --join          Join server thread.
      -k, --key-store=<keyStore>
                          JKS keyStore with the keys for https.
      -l, --war-location=<warLocation>
                          Directory to search for .war files.
      -o, --open-url      Open the web console automatic in the web browser.
      -p, --port=<port>   Port number.
      -s, --key-store-pass=<keyStorePass>
                          Password for the JKS keyStore with the keys for https.
      -V, --version       Print Hawtio version
      -w, --war=<war>     War file or directory of the hawtio web application.
    Copy to Clipboard Toggle word wrap

2.3. Running a Quarkus app

You can attach HawtIO to your Quarkus application in a single step.

Procedure:

  1. Add io.hawt:hawtio-quarkus and the supporting Camel Quarkus extensions to the dependencies in pom.xml:

    <dependencyManagement>
      <dependencies>
        <dependency>
          <groupId>io.hawt</groupId>
          <artifactId>hawtio-bom</artifactId>
          <version>4.0.0.redhat-00040</version>
          <type>pom</type>
          <scope>import</scope>
        </dependency>
      </dependencies>
      <!-- ... other BOMs or dependencies ... -->
    </dependencyManagement>
    
    <dependencies>
      <dependency>
        <groupId>io.hawt</groupId>
        <artifactId>hawtio-quarkus</artifactId>
      </dependency>
    
       <!-- Mandatory for enabling Camel management via JMX / Hawtio -->
      <dependency>
        <groupId>org.apache.camel.quarkus</groupId>
        <artifactId>camel-management-starter</artifactId>
      </dependency>
    
      <!-- (Optional) Required for Hawtio Camel route diagram tab -->
      <dependency>
        <groupId>org.apache.camel.quarkus</groupId>
        <artifactId>camel-quarkus-jaxb</artifactId>
      </dependency>
    
      <!-- ... other dependencies ... -->
    </dependencies>
    Copy to Clipboard Toggle word wrap
  2. Run HawtIO with your Quarkus application in development mode as follows:

    mvn compile quarkus:dev
    Copy to Clipboard Toggle word wrap
  3. Open http://localhost:8080/hawtio to view the HawtIO console.

2.4. Running a Spring Boot app

You can attach HawtIO to your Spring Boot application in two steps.

Procedure:

  1. Add io.hawt:hawtio-springboot and the supporting Camel Spring Boot starters to the dependencies in pom.xml:

    <dependencyManagement>
      <dependencies>
        <dependency>
          <groupId>io.hawt</groupId>
          <artifactId>hawtio-bom</artifactId>
          <version>4.0.0.redhat-00040</version>
          <type>pom</type>
          <scope>import</scope>
        </dependency>
        <!-- ... other BOMs or dependencies ... -->
      </dependencies>
    </dependencyManagement>
    
    <dependencies>
      <dependency>
        <groupId>io.hawt</groupId>
        <artifactId>hawtio-springboot</artifactId>
      </dependency>
    
       <!-- Mandatory for enabling Camel management via JMX / Hawtio -->
      <dependency>
        <groupId>org.apache.camel.springboot</groupId>
        <artifactId>camel-management-starter</artifactId>
      </dependency>
    
      <!-- (Optional) Required for Hawtio Camel route diagram tab -->
      <dependency>
        <groupId>org.apache.camel.springboot</groupId>
        <artifactId>camel-spring-boot-xml-starter</artifactId>
      </dependency>
    
      <!-- ... other dependencies ... -->
    </dependencies>
    Copy to Clipboard Toggle word wrap
  2. Enable the HawtIO and Jolokia endpoints by adding the following lines to application.properties:

    spring.jmx.enabled = true
    management.endpoints.web.exposure.include = hawtio,jolokia
    Copy to Clipboard Toggle word wrap
  3. Run HawtIO with your Spring Boot application in development mode as follows:

    mvn spring-boot:run
    Copy to Clipboard Toggle word wrap
  4. Open http://localhost:8080/actuator/hawtio to view the HawtIO console.

2.4.1. Configuring HawtIO path

If you don’t prefer to have the /actuator base path for the HawtIO endpoint, you can also execute the following:

  1. Customize the Spring Boot management base path with the management.endpoints.web.base-path property:

    management.endpoints.web.base-path = /
    Copy to Clipboard Toggle word wrap
  2. You can also customize the path to the HawtIO endpoint by setting the management.endpoints.web.path-mapping.hawtio property:

    management.endpoints.web.path-mapping.hawtio = hawtio/console
    Copy to Clipboard Toggle word wrap
  3. Example:

    1. There is a working Spring Boot example that shows how to monitor a web application that exposes information about Apache Camel routes, metrics, etc. with HawtIO Spring Boot example.
    2. A good MBean for real-time values and charts is java.lang/OperatingSystem. Try looking at Camel routes. Notice that as you change selections in the tree the list of tabs available changes dynamically based on the content.
Torna in cima
Red Hat logoGithubredditYoutubeTwitter

Formazione

Prova, acquista e vendi

Community

Informazioni sulla documentazione di Red Hat

Aiutiamo gli utenti Red Hat a innovarsi e raggiungere i propri obiettivi con i nostri prodotti e servizi grazie a contenuti di cui possono fidarsi. Esplora i nostri ultimi aggiornamenti.

Rendiamo l’open source più inclusivo

Red Hat si impegna a sostituire il linguaggio problematico nel codice, nella documentazione e nelle proprietà web. Per maggiori dettagli, visita il Blog di Red Hat.

Informazioni su Red Hat

Forniamo soluzioni consolidate che rendono più semplice per le aziende lavorare su piattaforme e ambienti diversi, dal datacenter centrale all'edge della rete.

Theme

© 2025 Red Hat