MQTT is a lightweight publish-subscribe protocol built for constrained devices. RabbitMQ is a multi-protocol message broker that added MQTT support through a plugin. The choice that matters is between a dedicated MQTT broker such as Mosquitto and RabbitMQ’s MQTT plugin.
MQTT vs. RabbitMQ: key takeaways
- MQTT is a lightweight publish-subscribe protocol. RabbitMQ is a multi-protocol message broker that supports MQTT through a plugin, alongside AMQP and STOMP.
- RabbitMQ does not support QoS 2 subscriptions. It downgrades QoS 2 publishes from MQTT 3.1.1 clients to QoS 1, and disconnects MQTT 5 clients that publish at QoS 2.
- A dedicated MQTT broker such as Mosquitto uses less memory per connection for resource-constrained IoT devices. RabbitMQ fits enterprise messaging across AMQP, STOMP, and MQTT in one broker.
- Cedalo builds Pro Mosquitto, a dedicated MQTT broker with clustering, high availability, and a management interface built for MQTT-based IoT and Industrial IoT communication.
What is MQTT?
MQTT is a publish-subscribe messaging protocol maintained by OASIS and built for devices with limited bandwidth, memory, or power. Clients publish messages to a topic and subscribe to the topics they need, without a direct connection between sender and receiver. A broker such as Mosquitto routes published messages to matching subscribers using the publish-subscribe model.
The MQTT protocol defines three quality-of-service levels, retained messages, and a Will Message that the broker publishes under the conditions defined by the protocol, such as an unexpected connection loss. These features fit sensor networks, vehicle telemetry, and factory equipment on connections that drop and reconnect often.
What is RabbitMQ?
RabbitMQ is an open-source message broker that supports AMQP 0-9-1 and AMQP 1.0 natively, with MQTT and STOMP available through plugins and an HTTP API intended mainly for management and monitoring. Producers publish messages to an exchange, which routes them to one or more queues based on routing keys and bindings. Consumers then read messages from a queue.
The MQTT plugin maps MQTT publish and subscribe operations to RabbitMQ’s exchange-and-queue model. Since RabbitMQ 3.12, it parses MQTT messages and sends them directly to queues instead of proxying them through AMQP 0-9-1. This lets RabbitMQ serve MQTT clients without requiring a second broker.
How do architecture and resource usage differ between MQTT and RabbitMQ?
A dedicated MQTT broker keeps a small per-connection footprint by design, since MQTT control packets have a fixed header of at least two bytes and use compact binary framing. Mosquitto runs on constrained hardware such as gateways, single-board computers, and edge devices with limited RAM.
RabbitMQ generally has a larger runtime footprint. It runs on the Erlang VM and uses queues and bindings for MQTT subscriptions, although eligible QoS 0 subscriptions can avoid a dedicated queue process. This can make it less suitable for highly memory-constrained edge devices. That weight buys protocol flexibility: a single RabbitMQ broker serves AMQP, MQTT, and STOMP clients side by side.
Which broker delivers better latency and throughput?
Message size and protocol overhead set the baseline for latency. MQTT’s compact framing keeps per-message overhead low, which matters at high publish frequency, such as sensor readings sent every few hundred milliseconds.
RabbitMQ’s MQTT plugin maps MQTT traffic directly to its routing and queue model. Its latency and throughput depend on message size, QoS, queue type, persistence, fan-out, hardware, and network conditions. For high-frequency telemetry with thousands of publishing devices, compare both options using workload-specific benchmarks instead of assuming a universal latency advantage.
How do MQTT and RabbitMQ handle topics and routing?
MQTT organizes messages into a topic hierarchy separated by slashes, and clients subscribe using wildcards: a plus sign for a single level, a hash symbol for multiple levels. This lets one subscriber listen to an entire branch of MQTT topics with a single subscription.
RabbitMQ maps that same hierarchy onto a topic exchange, where each MQTT topic becomes a routing key and each subscription becomes a binding. The mapping works for standard wildcard patterns, but administrators who need to inspect or adjust routing logic now manage AMQP exchange configuration instead of a topic tree.
Does RabbitMQ support MQTT the same way a dedicated MQTT broker does?
RabbitMQ’s MQTT plugin covers the protocol basics, but it does not match every capability of a broker built for MQTT from the ground up.
MQTT QoS support in RabbitMQ vs. Mosquitto
MQTT QoS defines the level of assurance for message delivery: QoS 0 provides at-most-once delivery, QoS 1 provides at-least-once delivery, and QoS 2 provides exactly-once delivery through a four-step handshake.
RabbitMQ does not support QoS 2 subscriptions. An MQTT 3.1.1 client that publishes at QoS 2 gets downgraded to QoS 1 automatically. An MQTT 5 client that publishes at QoS 2 gets disconnected instead, with a reason code reporting QoS as unsupported (RabbitMQ MQTT plugin documentation). A dedicated MQTT broker, such as Mosquitto, supports all three QoS levels as specified for both protocol versions.
Session persistence and retained messages on RabbitMQ
RabbitMQ supports retained messages and persistent sessions through its MQTT plugin, with trade-offs. Shared subscriptions are not supported, so multiple consumers cannot load-balance a single subscription. Retained messages are stored per cluster node rather than replicated, and the default on-disk store caps out at roughly 2 GB per vhost. A broker built for MQTT retained messages and sessions from the start, such as Mosquitto, treats these as core protocol features rather than an addition to an AMQP queue model.
Avoid costly errors from lost or duplicate MQTT messages
Prevent duplicate MQTT message delivery where QoS 2 is used. Cedalo's Pro Mosquitto supports MQTT QoS 2 for exactly-once message delivery at the MQTT protocol level.
How do MQTT and RabbitMQ compare on scalability?
Open-source Mosquitto has no built-in clustering. Teams can connect multiple brokers using bridge configurations, although bridging is not equivalent to built-in clustering. For clustered deployments, they can use Cedalo’s Pro Mosquitto, which offers active-passive High Availability with automatic failover and, for active-active scaling to large client counts, High Performance Clustering (introduced in Cedalo MQTT Platform 3.2).
RabbitMQ clusters natively across multiple nodes using Erlang’s distributed runtime, with queue types built for replication across the cluster. MQTT clients connected through the plugin can use these cluster capabilities, but failover behavior depends on the QoS level, session settings, and selected queue type.
Which broker offers stronger security and simpler operations?
Both brokers support TLS for transport encryption and client certificate authentication. MQTT brokers typically apply access control at the topic level, granting clients read or write permission for specific topic patterns. RabbitMQ combines vhost, exchange, and queue permissions with MQTT topic authorization through its topic-exchange model.
Day-to-day operations differ more than security. Monitoring a dedicated MQTT broker means watching connections, topics, and message rates directly. Monitoring RabbitMQ for MQTT traffic means reading exchange and queue metrics and translating them back into MQTT terms.
MQTT vs. RabbitMQ: decision matrix for common scenarios
The right broker depends on what connects to it and how the setup needs to grow.
| Scenario | Best fit | Why |
|---|---|---|
| Resource-constrained devices (sensors, edge gateways) | Dedicated MQTT broker (Mosquitto) | Small footprint, native QoS 0-2, low overhead per connection |
| Industrial IoT / Unified Namespace | Dedicated MQTT broker with clustering | Native topic hierarchy and retained messages, high availability, no translation layer |
| Enterprise messaging across protocols | RabbitMQ | AMQP, STOMP, and MQTT clients on one broker, useful when MQTT is one traffic type among several |
| Hybrid environments (existing RabbitMQ plus IoT expansion) | RabbitMQ MQTT plugin, or a bridge to a dedicated MQTT broker | Keeps one broker while MQTT volume stays low; a bridge adds a dedicated broker once MQTT becomes the primary traffic |
RabbitMQ’s MQTT plugin fits when MQTT is one of several workloads on a broker that also runs AMQP or STOMP. A dedicated MQTT broker may fit when MQTT-specific features, constrained hardware, QoS 2, or Unified Namespace tooling are primary requirements. Connection count alone is not a reliable decision threshold.
MQTT vs AMQP: where does this fit into the RabbitMQ question?
MQTT and AMQP 0-9-1 are both messaging protocols, but they solve different problems, and RabbitMQ originated on the AMQP 0-9-1 side of that split.
AMQP 0-9-1 defines exchanges, queues, and bindings as first-class concepts, with delivery guarantees, transactions, and routing logic built into the protocol. RabbitMQ implements AMQP 0-9-1 natively, which is why exchange-based routing fits its model. MQTT uses a compact topic-based model designed for publish-subscribe communication and constrained devices.
The RabbitMQ MQTT vs. AMQP 0-9-1 decision comes down to what a system needs. Exchanges, transactions, and complex routing point toward AMQP 0-9-1. Lightweight publish-subscribe communication points toward MQTT.
For teams comparing message brokers more broadly, MQTT vs. Kafka covers a different trade-off between event streaming and lightweight publish-subscribe messaging, while MQTT vs. HTTP explains how MQTT can reduce protocol and connection overhead in many constrained-device workloads.
Build MQTT communication that scales with enterprise Mosquitto
Picking between MQTT and RabbitMQ gets easier once you separate the protocol question from the broker question. A dedicated MQTT broker typically provides a small footprint and support for QoS 0, 1, and 2 for sensor networks, Industrial IoT, and other resource-constrained deployments. RabbitMQ fits systems that also run AMQP or STOMP workloads. For device-focused architectures, clustering, high availability, and QoS 2 support may be more important than protocol flexibility.
Your advantages with Cedalo:
- With Pro Mosquitto, you get active-passive High Availability with automatic failover between nodes, plus active-active High Performance Clustering for scaling to large client counts.
- You keep support for MQTT QoS levels 0, 1, and 2.
- You manage connections, topics, and message rates through one Management Center built for MQTT.
- You scale from a single edge gateway to a clustered, highly available broker on the same product line.
Start your free trial of Cedalo's MQTT platform
Reduce the need for separate uptime, security, and monitoring tools. Cedalo's Pro Mosquitto Broker provides centralized visibility into connections and metrics, improving integration management.
MQTT vs. RabbitMQ – frequently asked questions
Which MQTT versions does RabbitMQ support?
RabbitMQ supports MQTT 3.1, MQTT 3.1.1, and MQTT 5.0 through a plugin included in its core distribution. Supported features and limitations depend on the RabbitMQ version, so check the plugin documentation for your deployment.
Can I bridge RabbitMQ to a dedicated MQTT broker?
RabbitMQ can exchange messages with a dedicated MQTT broker through an external MQTT-capable bridge or connector. RabbitMQ Shovel and Federation do not connect directly to MQTT endpoints. This setup can keep AMQP workloads on RabbitMQ while a separate broker handles MQTT device traffic.
Is Cedalo’s Pro Mosquitto open source like RabbitMQ?
Cedalo builds Pro Mosquitto on Eclipse Mosquitto, an open-source MQTT broker, and adds clustering, security, and a Management Center under a commercial license. RabbitMQ is also available as an open-source broker, with commercial support offered separately.
Can I migrate from RabbitMQ’s MQTT plugin to Cedalo without changing my device code?
In many standards-based deployments, devices can connect to Cedalo’s Pro Mosquitto Broker using the same MQTT client libraries and topic structure. However, broker addresses, authentication, certificates, permissions, session behavior, and broker-specific features must be reviewed and tested.
Is MQTT still relevant when RabbitMQ already covers messaging?
MQTT is widely used in Industrial IoT, smart manufacturing, and connected vehicles. Teams that already run RabbitMQ for application messaging may add a dedicated MQTT broker when MQTT-specific requirements or device volume increase. Connection count alone is not a reliable threshold for changing brokers.
Does RabbitMQ’s MQTT plugin support Sparkplug B?
Only at the transport level. Sparkplug B runs over standard MQTT, and RabbitMQ’s mqtt.sparkplug setting exists purely to stop the plugin from mangling the mandatory spBv1.0 namespace: RabbitMQ maps the MQTT slash to an AMQP dot internally, which otherwise breaks the dotted spBv1.0 prefix. That flag does not make RabbitMQ Sparkplug-aware. There is no birth-certificate handling, no payload decoding, and no Unified Namespace tooling.
Pro Mosquitto is where Sparkplug support is actually built out. Eclipse Mosquitto is Sparkplug-compliant out of the box, and Pro Mosquitto adds a Sparkplug-aware plugin that automatically republishes every NBIRTH and DBIRTH message under the $sparkplug/certificates/ namespace. This gives you a persistent, queryable store of birth certificates, so consuming applications and SCADA systems can discover devices and their metrics without prior configuration. Combined with topic-tree inspection in the Management Center, it makes Pro Mosquitto a purpose-built broker for Sparkplug-based Unified Namespace architectures, rather than a transport that merely leaves the namespace intact.