Over Christmas I read an article about the Internet of Vehicles(IoV) which got me thinking about “edge brokers”. In “real-world” deployments connectivity to Azure EventGrid MQTT Broker would not 100% reliable so I have been looking at lightweight edge brokers.
A Message Queue Telemetry Transport(MQTT) broker with a small footprint (so it could run on a device like my Seeedstudio Edgebox 200), MQTT V5 support, local message persistence for disconnected operation, X509 certificate mutual authentication (so I could connect to Azure EventGrid MQTT Broker) were requirements. I initially looked at
- NanoMQ is a Linux Foundation Edge project. It is ultra-lightweight with a footprint of less than 200Kb when deployed with the minimum feature set, is cross platform (POSIX), has MQTT V5 support, bridging, and message persistence. The support for secure deployment is very limited.
- EMQX Edge is an ultra-lightweight MQTT broker built on NanoMQ. It has full MQTT 5.0 & 3.1.1 Support, an SQL-based rule engine to process data in real-time, a bi-directional Bridge to EMQX Cloud(and others), integration with the Open Platform Communication(OPC) Unified Architecture(UA), Modbus devices, high availability clustering, enterprise level security (unlike NanoMQ) and a REST API management. There is a free trial version which supports up to 10 connections
- Eclipse Mosquitto is another open-source message broker that implements the MQTT versions 5.0, 3.1.1 and 3.1. It is lightweight and is suitable for use on all devices from low power single board computers to full servers.
- Pro Mosquitto (Cedalo) has professional support with additional tooling for management, operations, high availability clustering, enhanced security and monitoring capabilities, with native integrations to a variety of databases and data streaming services. There is a free version, but it is limited to a single broker.
- HiveMQ Edge is an MQTT V5, V3.1.1 and V3.1 compliant, with protocol adapters which connect various industrial communication protocols and integrate several database engines, bidirectional connections to enterprise brokers. For disconnected scenarios messages are stored on disk and published once online. There are opensource(community support) and commercial versions (additional features and support). The open-source version does not include offline persistence.
- Azure IoT Operations Edge MQTT Broker supports the messaging layer in Azure IoT Operations and supports MQTT v3.1.1 and MQTT v5. The MQTT broker supports multiple authentication methods for clients. Azure IoT Operations uses the Azure Arc platform which provides a hybrid cloud experience for managing configuration with Azure Resource Manager (ARM) and other tools like the Azure portal, Bicep, and the Azure CLI. This looked like an “awfully big hammer”
I started by downloading and extracting the Windows X64 version of nanoMQ (started with the debug version).
The only change I had to make was the listener configuration.
Shortly after launching NanoMQ I could connect to it using MQTTX (from EMQX)

I then modified my nanoFramework Azure Event Grid MQTT broker client to connect to the NanoMQ instance running on my development environment.
The nanoFramework Azure Event Grid MQTT broker client could publish and subscribe to topics

The MQTTX application could also publish and subscribe to topics

Downloading nanoMQ, figuring out the configuration file modifications, and modifying my Azure Event Grid MQTT broker client took less than an hour.
BUT: I cut corners, the support for secure connections to nanoMQ is very limited and this setup should only be used for basic proof of concepts






















