Chapter 5. Plugins
Chapter 5. Plugins HawtIO is highly modular, and it includes plugins for different technologies out of the box. HawtIO plugins are essentially React components that are self-contained with all the JavaScript, CSS, and images to make them work. They can utilise HawtIO core features such as authentication and event notification through the Plugin API. The only requirement for a plugin is to provide the entrypoint that HawtIO can load it from, which must conform to the specification of Webpack Module Federation . HawtIO uses JMX to discover which MBeans are present and then dynamically updates the navigation bars and tabs based on what it finds. The UI is updated whenever HawtIO reloads the MBean, which it does periodically or a plugin can trigger explicitly. Relying on JMX for discovery doesn't mean that plugins can only interact with JMX. They can do anything at all that a browser can, e.g. use REST to discover UI capabilities and other plugins. 5.1. Built-in plugins The following plugins are all included by default in HawtIO: Table 5.1. List of built-in plugins Plugin Description Camel Adds support for Apache Camel . Allows you to browse Camel contexts, routes, endpoints, etc.; visualise running routes and their metrics; create endpoints; send messages; trace message flows; and profile routes to identify which parts runs fast or slow. Requirements A Camel application needs to be running in the JVM. The Camel application needs to include Camel Management component to enable JMX. The Source tab requires Camel XML DSL support. The Debug tab requires Camel Debug component. The Trace tab requires enabling of Camel Tracer . Connect Allows you to connect to local or remote JVMs. Requirements The Discover tab requires io.hawt:hawtio-local-jvm-mbean to the dependencies. Diagnostics Allows you to control the Java Flight Recorder, see class histogram and access to JVM flags. Not yet ported to v3. JMX Provides the core JMX support for interacting with MBeans, viewing real time attributes, charting, and invoking operations. Logs Provides support for viewing the logs inside the JVM. Requirements Requires io.hawt:hawtio-log and a logging framework-specific implementation for hawtio-log to the dependencies. Currently, only io.hawt:hawtio-log-logback is provided. Quartz Allows you to view the status of Quartz schedulers and configure them. Also allows you to configure and fire jobs and triggers from the console. If you use Camel Quartz component with your Camel application, this plugin will be automatically enabled. Runtime Provides general overview of the Java process including threads, system properties, and key metrics. Spring Boot Shows information about the Spring Boot application. Requirements Requires Spring Boot Health, Info, Loggers, and HTTP Exchanges endpoints to be exposed to activate each corresponding tab in the plugin. 5.2. Known external plugins The following plugins are developed by external communities. Apache ActiveMQ Artemis plugin Apache ActiveMQ Artemis ships with its own web management console, which is built on top of HawtIO with an external plugin that provides the dedicated view for Artemis brokers. You can navigate the acceptors and addresses through the console and operate on them. See Artemis User Manual - Management Console for more information. 5.3. Custom plugins You can also extend the HawtIO capabilities by developing a custom plugin. Typically, plugin development involves TypeScript, React, and PatternFly v4. For now, we have a few examples that demonstrate how you can develop a custom plugin to extend HawtIO. Sample plugin within the HawtIO project examples https://github.com/hawtio/hawtio/tree/4.x/examples/sample-plugin The simplest form of a HawtIO plugin. It packages itself as a JAR, and then can be used by including it as a dependency in a Java project. Sample plugin for Spring Boot https://github.com/hawtio/hawtio-sample-plugin-ts This sample demonstrates how to write and use a custom HawtIO plugin in a Spring Boot application. Sample plugin as a WAR application https://github.com/hawtio/hawtio-sample-war-plugin-ts This sample demonstrates how to write a custom HawtIO plugin as a WAR file, which can be later deployed to an application server such as Jetty, WildFly, and Tomcat. 5.3.1. Resources for plugin development Here is a list of useful references for developing a HawtIO plugin. TypeScript Handbook React Reference PatternFly v4 Webpack Module Federation