Skip to content

HiveMQ Plugins: Client Status and Retained Messages Query Plugin

by HiveMQ Team
3 min read

Our friends at ART+COM just released two of their HiveMQ plugins to the public. They are available on Github and may be useful to many MQTT deployments that need to utilize HTTP as an information channel.

HiveMQ Client Status Plugin

This plugin is unfortunately no longer available at Github.

This plugin exposes a HTTP GET endpoint to retrieve the currently connected and disconnected clients with their respective client identifiers and IP addresses. It is useful if you need to quickly check what clients are connected to the broker.

It creates a new HTTP GET endpoint /clients and returns a HTTP Response like this:

[ {
  "clientId" : "another client",
  "ip" : "127.0.0.1",
  "connected" : true
}, {
  "clientId" : "my-inactive-client",
  "connected" : false
} ]

HiveMQ Retained Message Query Plugin

This plugin is available in Github.

This plugin allows to query retained messages via HTTP instead of MQTT from HiveMQ. You can read about the motivation to write this plugin by the folks at ART+COM in the blog.

In short, this plugin exposes a HTTP Endpoint that expects a POST request with a query.

An example query could look like this:

{
  "topic": "path/of/the/topic",
  "depth": 0,
  "flatten": false
}

A response would look like this:

{
  "topic": "path/of/the/topic",
  "payload": "23",
  "children": [
	{
	  "topic": "path/of/child/topic",
	  "payload": "\"foo\""
	}
  ]
}

If you’re a MQTT.JS user, there is a small library called mqtt-topping by the ART+COM people that adds syntactic sugar for this plugin.

We hope you like the plugins as much as we do. Let us know in the comments what you think!

There's a whole suite of MQTT client libraries listed here. Do check out our MQTT Client Library page.

HiveMQ Team

The HiveMQ team loves writing about MQTT, Sparkplug, Industrial IoT, protocols, how to deploy our platform, and more. We focus on industries ranging from energy, to transportation and logistics, to automotive manufacturing. Our experts are here to help, contact us with any questions.

HiveMQ logo
Review HiveMQ on G2