Este contenido no está disponible en el idioma seleccionado.
Chapter 2. Installing HawtIO
There are several options to start using the HawtIO console:
2.1. Adding Red Hat repositories to Maven Copiar enlaceEnlace copiado en el portapapeles!
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:
In the
settings.xmlfile, addrepositoryelements for the Red Hat repositories as shown in this example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
2.2. Running from CLI (JBang) Copiar enlaceEnlace copiado en el portapapeles!
You can install and run HawtIO from CLI using JBang.
If you don’t have JBang locally yet, first install it: https://www.jbang.dev/download/
Procedure:
Install the latest HawtIO on your machine using the
jbangcommand:jbang app install -Dhawtio.jbang.version=4.0.0.redhat-00040 hawtio@hawtio/hawtio
$ jbang app install -Dhawtio.jbang.version=4.0.0.redhat-00040 hawtio@hawtio/hawtioCopy to Clipboard Copied! Toggle word wrap Toggle overflow NoteThis installation method is available only with jbang>=0.115.0.
It will install the HawtIO command. Launch a HawtIO instance with the following command:
hawtio
$ hawtioCopy to Clipboard Copied! Toggle word wrap Toggle overflow 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
$ hawtio --port 8090Copy to Clipboard Copied! Toggle word wrap Toggle overflow For more information on the configuration options of the CLI, run the following code:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
2.3. Running a Quarkus app Copiar enlaceEnlace copiado en el portapapeles!
You can attach HawtIO to your Quarkus application in a single step.
Procedure:
Add
io.hawt:hawtio-quarkusand the supporting Camel Quarkus extensions to the dependencies inpom.xml:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run HawtIO with your Quarkus application in development mode as follows:
mvn compile quarkus:dev
mvn compile quarkus:devCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Open http://localhost:8080/hawtio to view the HawtIO console.
2.4. Running a Spring Boot app Copiar enlaceEnlace copiado en el portapapeles!
You can attach HawtIO to your Spring Boot application in two steps.
Procedure:
Add
io.hawt:hawtio-springbootand the supporting Camel Spring Boot starters to the dependencies inpom.xml:Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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
spring.jmx.enabled = true management.endpoints.web.exposure.include = hawtio,jolokiaCopy to Clipboard Copied! Toggle word wrap Toggle overflow Run HawtIO with your Spring Boot application in development mode as follows:
mvn spring-boot:run
mvn spring-boot:runCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Open http://localhost:8080/actuator/hawtio to view the HawtIO console.
2.4.1. Configuring HawtIO path Copiar enlaceEnlace copiado en el portapapeles!
If you don’t prefer to have the /actuator base path for the HawtIO endpoint, you can also execute the following:
Customize the Spring Boot management base path with the
management.endpoints.web.base-pathproperty:management.endpoints.web.base-path = /
management.endpoints.web.base-path = /Copy to Clipboard Copied! Toggle word wrap Toggle overflow You can also customize the path to the HawtIO endpoint by setting the
management.endpoints.web.path-mapping.hawtioproperty:management.endpoints.web.path-mapping.hawtio = hawtio/console
management.endpoints.web.path-mapping.hawtio = hawtio/consoleCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example:
- 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.
-
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.