HiveMQ Plugins: Client Status and Retained Messages Query Plugin

Written by The HiveMQ Team

Category: HiveMQ

Published: September 22, 2016


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 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:

1
2
3
4
5
6
7
8
[ {
  "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 at 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:

1
2
3
4
5
{
  "topic": "path/of/the/topic",
  "depth": 0,
  "flatten": false
}

A response would look like this:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
{
  "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!

About The HiveMQ Team

We love writing about MQTT, IoT protocols and architecture in general. Our experts are here to help, so reach out to us if we can help!
Contact us
Creating highly available and ultra-scalable MQTT clusters
HiveMQ - Influxdb Monitoring Plugin