dispatch-plugin.war is a standalone hawtio plugin that can be deployed in a server alongside the main hawtio-web application.
The project creates a war file that can be deployed in various application services and is also OSGi-ified so it deploys nicely into Apache Karaf.
The fastest way to use the console is to run the docker image. Follow the installation/run instruction on that page.
The dispatch-plugin.war file is pre-built and can be installed alongside the hawtio.war on any system with a modern java installation. If you want to build the dispatch-plugin.war from source:
clone the hawtio git repo
$ git clone https://github.com/hawtio/hawtio.git
build hawtio
$ cd hawtio
$ mvn clean install
If you encounter any errors when building hawtio, visit the hawtio build page for help.
create a dispatch dir under the hawtio dir and copy the source code
$ mkdir dispatch
$ cp -r {dir where this file is located}/dispatch/* dispatch/
do a maven build of dispatch
$ cd dispach
$ mvn package
The dispatch-plugin-1.4.60.war file should now be in the target directory.
Copy the dispatch-plugin-1.4.60.war file as the following name
dispatch-plugin.war
to the deploy directory of Apache Tomcat or similar Java web container. Ensure the hawtio.war file is present in the same directory. Point a browser at http://<tomcathost:post>/hawtio Dispatch Router should be available as a tab in the console.
On the Dispatch Router's console page, select the Connect sub tab. Enter the address of a dispatch router. Enter the port of a websockets to tcp proxy and click the Connect button.
The console communicates to a router using Qpid Proton's rhea javascript binding. When run from a browser, it uses websockets. The router communicates using tcp. Therefore a websockts/tcp proxy is required.
A popular python based proxy is websockify. To use it:
$ git clone https://github.com/kanaka/websockify.git $ cd websockify $ ./run 5673 0.0.0.0:20009 &
In the above, websockify is listening for ws traffic on port 5673 and will proxy it to 0.0.0.0:20009. One of the routers will need a listener on the proxied port. An example router .conf file entry is:
listener { name: ProxyListener role: normal addr: 0.0.0.0 port: 20009 sasl-mechanisms: ANONYMOUS }
You can automatically start the proxy program when a router starts. Add the listener above and the following console section to a router's config file.
console { listener: ProxyListener proxy: /pathToWebsockify/run wsport: 5673 }
The value for proxy: can be any program that has execute permission. The router will execute it and pass addr:port as arguments.