AMQP · Study deck

MQTT and AMQP: Routing Architectures

MQTT and AMQP are not rivals so much as tools for different parts of the route.

Broker Bex is your guide for this deck.

mqttcases
Broker Bex, the module guide, in a scene from this chapter.
iotclass.org

After studying this chapter

Learning objectives

You will be able to:

  • Trace architecture comparison: mqtt vs amqp data flow across its components and failure boundaries.
  • Define amqp and mqtt hybrid bridge contracts with explicit inputs, errors, and change rules.
  • Decide whether MQTT, AMQP, or a hybrid bridge owns each layer of an IoT system.
  • Compare MQTT topics, retained messages, QoS, and Last Will behavior with AMQP exchanges, queues, acknowledgments, and dead-letter routing.
iotclass.org

Major section

Architecture Comparison: MQTT vs AMQP Data Flow

Exchanges decide matches while queues decouple delivery and processing.

  • That separation enables backend fan-out and work distribution, but it also creates topology and failure policies the operator must own.

Why it matters

That simplicity reduces device-side burden while leaving durable backend work distribution to another layer when needed.

MQTT architecture showing IoT sensors publishing to topic hierarchy with broker distributing messages to multiple subscribers
MQTT architecture showing IoT sensors publishing to topic hierarchy with broker distributing messages to multiple subscribers
iotclass.org

Major section

Hybrid Architecture Pattern

At the bridge, topic mapping, buffering, replay, and identifiers must survive failure.

  • This connects protocol placement to an explicit owner for backlog and duplicate handling.
Hybrid MQTT-AMQP architecture showing protocol bridge connecting MQTT broker at edge to AMQP exchanges in enterprise backend
Hybrid MQTT-AMQP architecture showing protocol bridge connecting MQTT broker at edge to AMQP exchanges in enterprise backend
iotclass.org

Major section

AMQP and MQTT Hybrid Bridge Contracts

The bridge is the border checkpoint that must preserve identity, routing meaning, replay rules, and monitoring evidence.

  • A protocol is an agreed set of exchange rules.
  • Telemetry is a time-linked record of a device or process.
  • Quality of service is a named delivery level, not proof that a business action happened.

Why it matters

Because they fit different layers, the common production shape is a hybrid : devices speak MQTT to a broker at the edge, and a bridge republishes those messages into AMQP for backend routing and durable work queues.

Protocol choice is a placement decision: MQTT usually owns constrained uplink, AMQP owns backend routing, and a bridge connects the two when both constraints matter.
Protocol choice is a placement decision: MQTT usually owns constrained uplink, AMQP owns backend routing, and a bridge connects the two when both constraints matter.
iotclass.org

Major section

AMQP and MQTT Hybrid Bridge Contracts (continued)

Message queuing telemetry transport (MQTT) is often used by devices to publish readings.

  • Advanced message queuing protocol (AMQP) is often used for richer service workflows.
  • The bridge must keep identity, time, unit, quality, and message age.
  • This evidence proves the named mapping and limits.
  • Many real systems use both.
iotclass.org

Major section

AMQP and MQTT Hybrid Bridge Contracts (continued)

That distinction becomes visible at scale.

  • If it changes a topic into a route but loses those fields, a valid delivery can still create a wrong action.
  • AMQP vs MQTT and Use Cases compares protocol overhead, feature fit, battery impact, decision trees, and hybrid architecture.
  • The wildcard difference is another migration trap.
iotclass.org

Major section

AMQP and MQTT Hybrid Bridge Contracts (continued)

MQTT and AMQP are both publish/subscribe, but they are tuned for opposite ends of an IoT system.

  • Lightweight, intermittent uplinks point toward MQTT; broker-side queues, richer routing, and replay controls point toward AMQP; mixed constraints lead to a bridge.
  • The route establishes the ownership boundaries that the rest of the chapter must make reliable.
  • The bridge needs its own reliability contract.
iotclass.org

Deck summary

Key takeaways

Exchanges decide matches while queues decouple delivery and processing.

  • At the bridge, topic mapping, buffering, replay, and identifiers must survive failure.
  • The bridge is the border checkpoint that must preserve identity, routing meaning, replay rules, and monitoring evidence.
  • Message queuing telemetry transport (MQTT) is often used by devices to publish readings.
  • That distinction becomes visible at scale.
iotclass.org

Retrieval practice

Recall check 1 of 6

Broker Bex says: answer from memory, then check your reasoning.

Q1Per this chapter's Architecture Comparison section, roughly how do the stated infrastructure costs compare between MQTT (for 50,000 devices via AWS IoT Core) and AMQP (via a RabbitMQ cluster)?

AMQTT costs about $96/year, while AMQP costs about $15,000 in setup plus $5,000/year in maintenance
BMQTT and AMQP cost approximately the same because both use cloud-hosted brokers
CAMQP costs about $96/year and MQTT costs $15,000 setup plus $5,000/year, since AMQP's routing sophistication reduces infrastructure needs
DBoth protocols are free open-source software with no infrastructure costs at any scale
Show answer

Answer: A see answers page

iotclass.org

Retrieval practice

Recall check 2 of 6

Broker Bex says: answer from memory, then check your reasoning.

Q2Place each protocol role at its hybrid boundary so you can explain where lightweight telemetry becomes durable enterprise work.

AMQTT Field Devices
BMQTT-to-AMQP Bridge
CAMQP Enterprise Services
Show answer

Answer: A A hybrid does not make MQTT and AMQP interchangeable: MQTT carries constrained field telemetry, the bridge maps interaction and delivery semantics, and AMQP coordinates durable enterprise work.

iotclass.org

Retrieval practice

Recall check 3 of 6

Broker Bex says: answer from memory, then check your reasoning.

Q3Complete the hybrid architecture bridge that subscribes to MQTT and republishes to AMQP:

Aamqp_channel.basic_publish(exchange='iot_bridge', routing_key=routing_key, body=msg.payload)
Bamqp_channel.send(exchange='iot_bridge', key=routing_key, data=msg.payload)
Camqp_channel.publish(exchange='iot_bridge', routing_key=routing_key, body=msg.payload)
Damqp_channel.basic_send(exchange='iot_bridge', routing_key=routing_key, body=msg.payload)
Show answer

Answer: A The bridge subscribes to MQTT topics using '#' wildcard (all subtopics) and republishes to AMQP using basic_publish.

iotclass.org

Retrieval practice

Recall check 4 of 6

Broker Bex says: answer from memory, then check your reasoning.

Q4Per this chapter's Overview section, for 20,000 meters each sending a 50-byte reading once a minute, roughly how does MQTT's bandwidth (2-byte header) compare to AMQP's (8-byte header) for that same payload path?

AMQTT is about 17.3 KB/s and AMQP is about 19.3 KB/s -- the AMQP framing overhead is measurable but not dramatic for a single meter
BMQTT is about 173 KB/s and AMQP is about 193 KB/s, ten times higher because of TLS overhead
CMQTT and AMQP use exactly the same bandwidth because both send the same 50-byte payload
DAMQP is far cheaper than MQTT because its exchange overhead replaces the need for TLS
Show answer

Answer: A

iotclass.org

Retrieval practice

Recall check 5 of 6

Broker Bex says: answer from memory, then check your reasoning.

Q5Per this chapter's Practitioner section, why does AMQP have no equivalent to MQTT's retained message?

ABecause AMQP queues every message for durable consumption (a work model), while MQTT's retained message keeps only the last value on a topic for new subscribers (a state model)
BBecause AMQP uses transient messages for live telemetry, leaving long-term state storage to the receiving application rather than the broker's own queue storage
CBecause MQTT retained values can become stale after a device disconnects, AMQP replaces retained state with message expiry to keep late consumers from acting on old readings
DBecause AMQP consumers retrieve state by polling a queue for the newest reading, while MQTT sends a retained reading when a client subscribes to the topic
Show answer

Answer: A

iotclass.org

Retrieval practice

Recall check 6 of 6

Broker Bex says: answer from memory, then check your reasoning.

Q6A fleet of constrained cellular sensors must send telemetry cheaply, and the backend must route it to several services with durable queues, load-balanced workers, and a dead-letter path. What architecture fits best?

AMQTT from devices to an edge broker, bridged to an AMQP topic exchange.
BAMQP directly on every sensor, because one protocol is simpler than two.
CMQTT everywhere, adding queues and dead-lettering in the MQTT broker.
DHTTP polling from each sensor to keep the stack uniform.
Show answer

Answer: A Use MQTT for constrained edge uplink and bridge into AMQP for durable, richly-routed, load-balanced backend processing; the bridge maps MQTT topics to AMQP topic-exchange routing keys.

iotclass.org

Print reference

Answers 1 of 2

Answer key.

  1. A · The chapter's Architecture Comparison section states MQTT's cost at roughly $96/year for 50,000 devices on AWS IoT Core, versus AMQP's roughly $15K setup plus $5K/year maintenance for a RabbitMQ cluster -- a stark contrast that reflects MQTT's simplicity versus AMQP's operational overhead for sophisticated routing.
  2. A · A hybrid does not make MQTT and AMQP interchangeable: MQTT carries constrained field telemetry, the bridge maps interaction and delivery semantics, and AMQP coordinates durable enterprise work.
iotclass.org

Print reference

Answers 2 of 2

Answer key.

  1. A · The bridge subscribes to MQTT topics using '#' wildcard (all subtopics) and republishes to AMQP using basic_publish.
  2. A
  3. A
  4. A · Use MQTT for constrained edge uplink and bridge into AMQP for durable, richly-routed, load-balanced backend processing; the bridge maps MQTT topics to AMQP topic-exchange routing keys.
iotclass.org