MQTT protocol is a widely used machine-to-machine communication protocol and an OASIS standard messaging protocol for the Internet of Things (IoT).
With a small footprint of less than 80 Kb, MQTT is simple and based on a publish-subscribe system. The key component is the MQTT broker. IoT devices communicating over this network are called MQTT clients. The clients can publish and subscribe to different topics. The devices serve as publishers, communicating the messages on these topics among IoT devices via the MQTT broker.
Essentially, the MQTT broker manages the topics and subscriptions and broadcasts the messages, typically to multiple subscribers.
The MQTT broker is a central hub that manages the data communication among IoT devices within a network. Typically, a microcomputer or WiFi development microcontroller board is installed and used as the MQTT broker. To operate as a broker, the microcomputer or board must run a MQTT broker program.
The MQTT protocol is open-source and both open-source and proprietary MQTT broker programs are available.
Here are some of the top MQTT broker choices this year.
Mosquitto. Eclipse Mosquitto is an open-source MQTT broker for MQTT protocol versions 5.0, 3.1.1, and 3.1. Mosquitto is lightweight and can be installed on low-power, single-board computers or enterprise servers. The broker is written in C programming language and can be implemented on MQTT clients with a C library. It can be downloaded for Windows, Mac, Linux, and Raspberry Pi. Ready-to-install binary files are available for all operating systems. The latest version includes an authentication and authorization plugin “mosquitto-go-auth,” a web user interface for managing Mosquitto instances. It also offers a PHP wrapper “Mosquitto-PHP” for creating MQTT clients in PHP.
EMQ X is currently the most scalable MQTT broker for IoT applications. It processes millions of MQTT messages in a second with sub-millisecond latency and allows messaging among more than 100 million clients within a single cluster. EMQ X is compliant with MQTT 5.0 and 3.x. It’s ideal for distributed IoT networks and can run on the cloud, Microsoft Azure, Amazon Web Services, and Google Cloud. The broker can implement MQTT over TLS/SSL and supports several authentication mechanisms like PSK, JWT, and X.509. Unlike Mosquitto, EMQX supports clustering via CLI, HTTP, API, and a dashboard.
Cassandana is a MQTT broker written in Java. An open-source enterprise messaging broker, it began as an arm of Mosquetto. The broker supports QoS, QoS 1, and QoS 2 with full compliance to MQTT 3.x and 5.0. The broker supports Cassandra, Redis, REST API, MySQL, PostgreSQL, WebSocket, and MongoDB for authentication and authorization.
RabbitMQ is an open-source messaging broker that implements MQTT, AMQP, STOMP, and other message-oriented protocols. It’s written in Erlang and can be downloaded for Linux, Mac-OS, Windows, and FreeBSD and supports MQTT 3.x (with a plugin), HTTP, and WebSocket.
Ejjaberd is another MQTT broker written in Erlang and supports MQTT protocol version 5.0. It runs on top of the XMPP server and can handle millions of concurrent connections. Essentially, it’s an XMPP server with support for MQTT and SIP services. The broker is managed by a command-line tool and can be customized for several applications using various hooks.
HiveMQ is an enterprise MQTT broker written in Java and compatible with MQTT 5.0 and 3.x. It connects to any device (up to 10 million in a cluster), easily integrating with enterprise systems, including SQL, NoSQL, and Kafka databases. HiveMQ supports TLS, authorization and authentication, OCSP stapling, and BoringSSL integration for security. It allows role-based access control to a real-time monitoring dashboard and supports advanced MQTT end-to-end analysis — with event log, backup, and restore features for MQTT data. The broker can be launched on Dockers, Kubernetes, OpenShift, DC/OS, HiveMQ cloud, and other cloud platforms, including Microsoft Azure, Amazon Web Services, and Google Cloud.
VerneMQ is a high-performance, distributed MQTT broker that competes with RabbitMQ. It’s an open-source MQTT broker written in Erlang OTP that supports MQTT 5.0, MQTT 3.1.1, and MQTT 3.1. The broker is tolerable to network failures and allows control over clustering and availability. VerneMQ can be used for mobile messaging, IoT, and smart home and city applications. Thanks to its availability, scalability, and flexibility, the broker can be deployed to many different use-cases.
MQTTnet is a high-performance .NET library for MQTT. It can be used to configure an MQTT broker and an MQTT client — with support up to MQTT 5.0. MQTTnet is a low-level lightweight implementation of MQTT, which requires no external dependencies. It’s capable of processing 150,000 messages per second and supports multiple protocol versions at the same time. For security, the library provides TLS support.
You may also like:
Filed Under: Featured Contributions