Code Monkey home page Code Monkey logo

hivemq-heartbeat-extension's Introduction

HiveMQ Heartbeat Extension

Extension Type GitHub release (latest by date) GitHub GitHub Workflow Status

Prerequisites

  • HiveMQ Enterprise Edition (EE) 4.2.0 or later

  • HiveMQ Community Edition (CE) 2020.1 or later

Purpose

This extension allows integration with load balancers and proxies. It provides a readiness check via HTTP, which means a service is able to detect if a HiveMQ instance is offline and the load balancer is thus able to remove the HiveMQ node from the load balancing.

Installation

  • Download the extension from the HiveMQ Marketplace.

  • Copy the content of the zip file to the extensions folder of your HiveMQ nodes.

  • Modify the extension-config.xml file for your needs.

Configuration

The Heartbeat extension uses its own configuration file 'extension-config.xml' which must be placed in the extensions folder of HiveMQ.

Config name Required Description

<port>

no

The port on which the heartbeat HTTP service should listen. Default is 9090

<bindAddress>

yes

The bind address of the heartbeat HTTP service. Use 0.0.0.0 if you want to listen on all interfaces.

<path>

no

The Path where the heartbeat HTTP service is located. Default ist /heartbeat

Example Configuration
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<heartbeat-extension-configuration>
        <port>9090</port>
        <bind-address>0.0.0.0</bind-address>
        <path>/heartbeat</path>
</heartbeat-extension-configuration>
Important
By Default the Heartbeat is available at http://MY-IP:9090/heartbeat

Metrics

This extension exposes a custom metric to HiveMQs holistic metric registry.

Metric name Type Description

http-heartbeat-meter

Meter

A meter that shows the frequency of heartbeat requests

Need Help?

If you encounter any problems, we are happy to help. The best place to get in contact is our support.

Contributing

If you want to contribute to HiveMQ Heartbeat Extension, see the contribution guidelines.

License

HiveMQ Heartbeat Extension is licensed under the APACHE LICENSE, VERSION 2.0. A copy of the license can be found here.

hivemq-heartbeat-extension's People

Contributors

dependabot[bot] avatar donnerbart avatar lukasbrand avatar renovate[bot] avatar sauroter avatar schaebo avatar sgtsilvio avatar yannickweber avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hivemq-heartbeat-extension's Issues

classdefnotfounderror when running on hive-community-edition

2019-10-15 20:58:21,277 ERROR - Extension with id "hivemq-heartbeat-extension" cannot be started because of an uncaught exception thrown by the extension. Extension will be disabled.
java.lang.NoClassDefFoundError: javax/servlet/http/HttpServlet
	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
	at java.base/java.lang.ClassLoader.defineClass(Unknown Source)
	at java.base/java.security.SecureClassLoader.defineClass(Unknown Source)
	at java.base/java.net.URLClassLoader.defineClass(Unknown Source)
	at java.base/java.net.URLClassLoader$1.run(Unknown Source)
	at java.base/java.net.URLClassLoader$1.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.net.URLClassLoader.findClass(Unknown Source)
	at com.hivemq.extensions.classloader.IsolatedPluginClassloader.loadClass(IsolatedPluginClassloader.java:119)
	at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
	at com.hivemq.extensions.heartbeat.HeartbeatMain.startRestService(HeartbeatMain.java:76)
	at com.hivemq.extensions.heartbeat.HeartbeatMain.extensionStart(HeartbeatMain.java:59)
	at com.hivemq.extensions.HiveMQExtensionImpl.start(HiveMQExtensionImpl.java:133)
	at com.hivemq.extensions.HiveMQPlugins.pluginStart(HiveMQPlugins.java:209)
	at com.hivemq.extensions.loader.PluginLifecycleHandlerImpl.lambda$startPlugin$0(PluginLifecycleHandlerImpl.java:82)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: javax.servlet.http.HttpServlet
	at java.base/java.net.URLClassLoader.findClass(Unknown Source)
	at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
	at com.hivemq.extensions.classloader.IsolatedPluginClassloader.loadClass(IsolatedPluginClassloader.java:123)
	at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
	... 18 common frames omitted

HiveMQ node reports ready when in terminating state.

Expected behavior

When calling System.exit(1) from an extension, traffic should no longer be routed to the HiveMQ node as it is shutting down.

Actual behavior

HiveMQ begins to shutdown, but it still receives traffic. Because there is sustained traffic to the node, it will never shutdown.

Details

  • Using HiveMQ 4.2.0

Suggested Change

Add UNAVAILABLE to LifeCycleStage so that new traffic is not routed to nodes that are trying to shutdown.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Pending Approval

These branches will be created by Renovate only once you click their checkbox below.

  • Update all major dependencies (major) (org.eclipse.jetty:jetty-server, com.sun.xml.bind:jaxb-impl, jakarta.xml.bind:jakarta.xml.bind-api)

Detected dependencies

github-actions
.github/workflows/check.yml
  • actions/checkout v4@a5ac7e51b41094c92402da3b24376905380afc29
  • actions/setup-java v4@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9
  • gradle/actions v3@db19848a5fa7950289d3668fb053140cf3028d43
  • docker/login-action v3@0d4c9c5ea7693da7b068278f7b52bda2a190a446
.github/workflows/releaseExtension.yml
  • actions/checkout v4@a5ac7e51b41094c92402da3b24376905380afc29
  • actions/setup-java v4@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9
  • gradle/actions v3@db19848a5fa7950289d3668fb053140cf3028d43
  • actions/upload-release-asset v1@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5
gradle
gradle.properties
settings.gradle.kts
build.gradle.kts
gradle/libs.versions.toml
  • org.apache.commons:commons-lang3 3.14.0
  • org.apache.commons:commons-text 1.12.0
  • com.hivemq:hivemq-mqtt-client 1.3.3
  • jakarta.xml.bind:jakarta.xml.bind-api 2.3.3
  • com.sun.xml.bind:jaxb-impl 2.3.9
  • org.jetbrains:annotations 24.1.0
  • org.eclipse.jetty:jetty-server 11.0.21
  • org.eclipse.jetty:jetty-servlet 11.0.21
  • ch.qos.logback:logback-classic 1.5.6
  • org.mockito:mockito-core 5.12.0
  • com.squareup.okhttp3:okhttp 4.12.0
  • org.testcontainers:hivemq 1.19.8
  • org.testcontainers:junit-jupiter 1.19.8
  • com.hivemq.extension 3.1.0
  • io.github.sgtsilvio.gradle.defaults 0.2.0
  • com.github.hierynomus.license 0.16.1

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.