Building a Unified Namespace: Why MQTT Outperforms AMQP
Is AMQP the Right Fit for Building a UNS?
AMQP (Advanced Message Queuing Protocol) has a well-earned reputation in enterprise IT for handling high-volume, transaction-heavy messaging. It originated from the banking sector, where guaranteed delivery, robust security, and transactional support were top priorities. Yet, when it comes to designing a Unified Namespace, AMQP struggles to meet the requirements for an enterprise UNS.
While AMQP is a powerful protocol with robust routing and delivery guarantees, its queue-and-exchange model introduces structural complexity that makes it less suited for the dynamic, high-scale nature of a Unified Namespace. The challenge isn't just about message frequency, it is more about the need to support flexible, hierarchical topic structures and a large number of loosely coupled, potentially unknown consumers.
AMQP uses a two-stage routing system built around this queue-and-exchange model. When a producer sends a message, it doesn’t go directly to a queue. Instead, it first arrives at an exchange, which examines message headers, routing keys, or other attributes to determine where the message should go.
Based on these rules, configured as so-called “bindings,” the exchange then directs the message to one or more queues. Consumers, in turn, subscribe to these queues to receive messages.
This design is flexible and powerful in IT-centric workflows, as different exchange types (such as direct, fanout, topic, or headers exchanges) allow for complex or custom routing patterns. For instance, a topic exchange can route messages based on wildcard patterns in routing keys, and a fanout exchange simply broadcasts all incoming messages to all bound queues.
However, while this flexibility is advantageous in certain enterprise scenarios, it also adds complexity as exchanges and queues need active management. Managing multiple exchanges, queues, and bindings can be overkill for simpler publish/subscribe use cases, particularly in industrial or edge environments where MQTT-style topic hierarchies are often more intuitive and straightforward. MQTT's model offers additional flexibility, as topics don't require upfront configuration or centralized management, they can be created on the fly simply by publishing or subscribing to them, making it ideal for rapidly evolving data landscapes.
Each message travels through an exchange, gets bound to a queue, and is then consumed by subscribers. This adds multiple points of configuration, routing, and acknowledgments, increasing complexity. In AMQP, an explicit queue binding is required, and subscribers must be explicitly registered. While in MQTT, any client can subscribe/unsubscribe dynamically.
Both AMQP and MQTT support publish-subscribe (pub/sub) messaging, but they handle fanout and topic-based routing differently. AMQP does not have native topic hierarchies like MQTT, but it does support pattern-based topic routing using topic exchanges and routing keys.
In industrial settings, networks can be unreliable, bandwidth-constrained, or prohibitively expensive. Edge devices, such as PLCs and microcontrollers, also tend to have limited resources in terms of CPU, memory, and power. This makes the lightweight nature of MQTT especially important. Unlike AMQP, which often requires a more complex client-side implementation to handle exchanges, queues, and stateful connections, MQTT is designed for simplicity, requiring minimal overhead to connect, publish, and subscribe. This makes it much easier to embed MQTT clients directly into constrained devices, enabling seamless participation in a UNS without burdening the device or increasing integration complexity. AMQP was never designed for these constraints. Instead, it’s strongly rooted in data-center environments and enterprise IT workloads, where robust CPU, memory, and network resources are typically available.
In AMQP, messages are usually delivered to one consumer per queue. Once a consumer receives a message from a queue, it’s removed and not seen by others. While AMQP supports broadcast-style messaging via fanout exchanges or multiple queues bound to the same exchange, this requires explicit configuration. In contrast, protocols like MQTT are inherently designed for multi-subscriber delivery, where all subscribers to a topic receive the message without competing for it.
Key Components of AMQP in Detail
Queues
A queue in AMQP is a message buffer
Stores messages until they are consumed by a subscriber (“consumer”)
FIFO (ordered) by default
Messages are delivered to one consumer by default
Many queues can receive the same message via exchange bindings (fan-out)
Exchange
An exchange is the message routing hub in AMQP, which routes the message to one or more queues
It receives messages from producers and decides which queue(s) the message should go to, based on rules like routing keys or types and bindings (direct, fanout, topic, headers)
Routing Keys
A routing key is a core concept in AMQP
It is a string attached to a message by the producer, used to determine how the message is routed by the exchange to one or more queues.
Producer
A producer connects to the AMQP broker and publishes messages to an exchange
The producer doesn’t know or care which queue or consumer will get the message: it just sends a message to a specific exchange, optionally with a routing key (promotes decoupling).
Consumers
A consumer is any application or service that receives messages from a queue.
Consumers are the endpoints that process the messages delivered by the AQMP broker.
They subscribe to queues, wait for incoming messages, and handle them (e.g., log them, act on them, store them, etc.).
You can attach multiple consumers to the same queue
The broker load-balances messages — usually each message goes to one consumer
AMQP Message Flow
PRODUCER → EXCHANGE → QUEUE(S) → CONSUMER(S)
The producer sends a message to an exchange
The exchange routes the message to one or more queues
The consumer connects to a queue and processes messages from it
AMQP Routing Keys Explained
A routing key is a string attached to a message by the producer that tells the exchange how to route the message to queues. It’s like an address label that guides the message from the exchange to the right queue(s).
The MQTT topic
bottleinc/berlin/filling/fillingline1/filler
is translated into an AMQP routing key by replacing '/' with '.'
bottleinc.berlin.filling.fillingline1.filler
AMQP Queue Bindings with Wildcards
AMQP allows the following wildcards in routing keys:
*
= matches exactly one word#
= matches zero or more words
You could use these wildcard binding keys in a topic exchange to subscribe to certain patterns:
Binding Key Pattern | Description |
---|---|
bottleinc.berlin.filling.*.*.status | Match all machines' status in filling area |
bottleinc.berlin.filling.fillingline1.*.* | Match all tags for all machines in fillingline1 |
bottleinc.berlin.filling.# | Match everything under filling |
bottleinc.*.filling.fillingline1.filler.* | Match any site, filler machine on line1, all tags |
bottleinc.berlin.*.*.*.temperature | Match all temperature readings in berlin site |
#.filler.status | Match any machine ending with .filler.status |
AMQP Message Flow with Routing Key
Explanation of Each Step
1. Producer
Sends a message to the exchange
Includes a routing key (e.g., bottleinc.berlin.filling.fillingline1.filler.status)
2. Exchange
Uses its type (direct, topic, etc.)
Applies binding key patterns (defined when queues are bound to the exchange)
Compares the routing key against the binding keys
Forwards the message to all matching queues
3. Queues
Store messages that matched their binding pattern
Each queue delivers messages to its subscribed consumer(s)
4. Consumers
Receive messages from the queue(s)
Process or act on the messages
Example Routing Key in Action
Given the routing key from the producer:
bottleinc.berlin.filling.fillingline1.filler
Queue Bindings: | |
---|---|
Queue A: bottleinc.berlin.filling.# | → ✅ match |
Queue B: bottleinc.*.filling.fillingline1.*.* | → ✅ match |
Queue C: bottleinc.munich.# | → ❌ no match |
Result:
The message goes to Queue A and Queue B
Queue C does not receive the message
Types of Exchanges in AMQP
There are four main types of exchanges in AMQP (0.9.1, used in RabbitMQ)
Exchange Type | Routing Behavior | Use Case |
---|---|---|
Direct | Exact match between routing key and queue binding key | Task queues, alerts |
Fanout | Broadcast to all bound queues, ignores routing key | Logs, notifications, pub/sub |
Topic | Pattern matching with wildcards (*, #) | Hierarchical event streams, telemetry |
Headers | Routing based on message headers | Complex rules (e.g., region + type) |
How Routing Keys Work by Exchange Type
Exchange Type | Routing Key Used? | How It Works |
---|---|---|
Direct | ✅ Yes | Exact match between routing key and queue binding |
Fanout | ❌ Ignored | Message is sent to all bound queues |
Topic | ✅ Yes | Pattern match with wildcards (* and #) |
Headers | ❌ Ignored | Routing based on headers instead of keys |
Why AMQP Routing Is Too Complex for a Unified Namespace
AMQP Requires a Heavy Routing Setup
In AMQP, messages are not sent directly to topics like in MQTT. Instead, messages are published to exchanges, which then route them to queues based on routing keys and bindings. This means that every route must be explicitly configured: you need to define exchanges, bind them to queues with the right keys, and manage those connections manually.
In contrast, MQTT lets clients simply publish and subscribe to topics - no setup required.
Static Infrastructure vs. Dynamic Topics
A UNS is all about representing the real-time state of an entire operation–from edge to site to enterprise cloud–using a live, dynamic topic tree. With MQTT, topics can be created on the fly. Clients can subscribe using wildcards without any pre-configuration. AMQP doesn’t offer this kind of flexibility. If a queue isn’t already bound to an exchange with the right pattern, the message is dropped — not ideal for dynamic, distributed architectures.
Routing Key Logic Adds Cognitive Overhead
AMQP’s routing keys are powerful but require deep understanding and coordination between producers, exchanges, and consumers. You need to choose the right exchange type (direct, topic, fanout, headers), configure binding keys, and understand how they match against message routing keys.
MQTT simplifies this. If you want all devices under fillingline1 to be monitored, you just subscribe to:
bottleinc/berlin/filling/fillingline1/+/status
No queues. No binding logic. Just topic-based filtering that matches how a UNS is modeled.
Queue Semantics vs. State Modeling
AMQP is built for work queues, where each message goes to one consumer and may be acknowledged or re-queued. That’s perfect for task distribution - not so much for UNS use cases where multiple systems need to consume the same state information. MQTT’s pub/sub model, especially with retained messages, is a better fit. It ensures late subscribers can still receive the current state without relying on complex buffering logic.
Key Reasons Why AMQP is Not an Ideal Protocol for a UNS:
Complex Exchange/Queue Model: AMQP’s reliance on exchanges and queues adds operational overhead and complicates large-scale industrial deployments.
Higher Protocol Overhead: The multi-step routing, acknowledgments, and transactional features can be overkill for lightweight, high-frequency industrial data.
Not OT-Focused: AMQP originated in banking and enterprise IT, so native support and tooling for industrial protocols (e.g., Sparkplug B) are limited.
Less Edge Compatibility: Industrial devices, which often have limited resources, typically support MQTT rather than AMQP, requiring additional integration layers.
No Native Retained Messages or “Last Will & Testament”: Features critical for real-time state updates and device monitoring must be implemented through custom logic rather than built-in protocol mechanisms.
Clustering Complexity: Scaling AMQP brokers to handle massive IoT or edge scenarios can involve intricate configurations, mirrored queues, and higher administrative overhead.
Weaker Hierarchical Topic Structure: Topic-based, tree-like data organization isn’t native to AMQP, making hierarchical device naming and filtering less intuitive.
Limited Industrial Ecosystem: AMQP lacks broad adoption in manufacturing, meaning fewer OT devices and gateways ship with built-in AMQP support.
Conclusion
AMQP is a powerful, enterprise-focused messaging protocol that shines in transactional or IT-centric environments, but it’s not an ideal backbone for a Unified Namespace in industrial settings. Unlike MQTT, which was designed to be lightweight and OT-friendly, AMQP uses an exchange–queue model that introduces more configuration overhead and resource consumption.
This complexity can bog down high-frequency, real-time data exchange required for a plant-wide or enterprise-wide UNS. Additionally, AMQP lacks native support for the hierarchical topic structures commonly used in a UNS making it more cumbersome to map industrial data and handle large numbers of edge devices. While AMQP excels at transactional guarantees and complex routing in IT environments, the simplicity, scalability, and lower overhead of MQTT typically make it a more natural fit for a UNS bridging OT and IT across multiple sites.
Do read our blogs, Why MQTT is Critical for Building a Unified Namespace and Beyond MQTT: The Fit and Limitations of Other Technologies in a UNS, to explore why MQTT is the only protocol that fully enables a scalable and real-time Unified Namespace (UNS), ensuring seamless data exchange at scale.

Jens Deters
Jens Deters is the Principal Consultant, Office of the CTO at HiveMQ. He has held various roles in IT and telecommunications over the past 22 years: software developer, IT trainer, project manager, product manager, consultant, and branch manager. As a long-time expert in MQTT and IIoT and developer of the popular GUI tool MQTT.fx, he and his team support HiveMQ customers every day in implementing the world's most exciting (I)IoT UseCases at leading brands and enterprises.