AMQP · Study deck

MQTT and AMQP: Operational Tradeoffs

MQTT and AMQP serve 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:

  • Compare AMQP and MQTT: Evaluate the strengths and weaknesses of each protocol for IoT scenarios
  • Select Appropriate Protocols: Justify the choice between AMQP, MQTT, and CoAP based on quantified application requirements
  • Design Hybrid Architectures: Construct systems that use MQTT for devices and AMQP for backend integration, specifying the protocol bridge configuration
  • Evaluate Protocol Overhead: Calculate message size, bandwidth consumption, and cost trade-offs for competing protocol choices
iotclass.org

Major section

In 60 Seconds

The reading may be replaced by a newer one.

  • The repair order must be kept, routed to the right team, and marked when work is complete.
  • The two services use different sets of message rules.
  • The system designer should not choose from a feature list alone.
  • A live room reading may favour a light path and the newest value.
iotclass.org

Major section

In 60 Seconds (continued)

A work order may need a durable waiting place and a clear final result.

  • They should know which message was sent, which receiver was stopped, what remained after restart, and which result counts as a pass.
  • If they cannot reproduce it, the design claim is too broad.
  • A status fact can become a work request.
iotclass.org

Major section

In 60 Seconds (continued)

In practice, many IoT architectures use both: MQTT at the device edge for sensor telemetry and AMQP in the backend for reliable message routing between services.

  • This order makes it clear which new need caused a more complex choice.
  • A one-user test can become a shared service.
  • This simple comparison leaves out many delivery and routing options.
iotclass.org

Major section

Phoebe's Field Notes: 5000 mAh Is Not One Number of Watt-Hours

The mathematical gist: A 5000 mAh label states charge, not energy: multiply 5 Ah by voltage to obtain watt-hours.

  • At 3.70 V the pack stores 18.5 Wh, while at 1.20 V it stores 6.00 Wh.
  • The chapter's protocol comparison is different.
iotclass.org

Major section

AMQP vs MQTT Showdown

"Which is better -- AMQP or MQTT?" asked Temperature Terry. The microcontroller shook his head. "Wrong question, Sammy!

  • It's like asking whether a bicycle or a truck is better.
  • It depends on what you need to carry!".
  • Max summed it up: "Use MQTT for simple sensor-to-cloud communication where battery life matters.

Why it matters

A tiny temperature sensor with limited battery can use MQTT because the messages are small and the protocol is simple.

iotclass.org

Major section

AMQP vs MQTT Showdown (continued)

"MQTT is like a bicycle," explained the LED. "It's lightweight, simple, and perfect for quick trips.

  • "AMQP is like a delivery truck," added the battery. "It's heavier and more complex, but it can route packages to dozens of different warehouses using exchange rules.
  • If you need a message to go to exactly three specific systems based on complicated rules -- like 'all temperature alerts above 50 degrees on floor 2' -- AMQP handles that on the server side.".
  • Many real IoT platforms actually use both -- MQTT at the edge, AMQP in the backend!".
iotclass.org

Major section

Protocol Selection Decision Tree

The chosen leaf should therefore be recorded with the constraint that caused it and revisited when that constraint changes.

  • MQTT excels at scale and simplicity, while AMQP provides rich enterprise features like routing and transactions.
Decision tree for selecting between MQTT and AMQP protocols based on device constraints, routing complexity, and transaction requirements
Decision tree for selecting between MQTT and AMQP protocols based on device constraints, routing complexity, and transaction requirements
iotclass.org

Deck summary

Key takeaways

The reading may be replaced by a newer one.

  • A work order may need a durable waiting place and a clear final result.
  • In practice, many IoT architectures use both: MQTT at the device edge for sensor telemetry and AMQP in the backend for reliable message routing between services.
  • The mathematical gist: A 5000 mAh label states charge, not energy: multiply 5 Ah by voltage to obtain watt-hours.
  • "Which is better -- AMQP or MQTT?" asked Temperature Terry. The microcontroller shook his head. "Wrong question, Sammy!
iotclass.org

Retrieval practice

Recall check 1 of 3

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

Q1A sensor fleet uses MQTT, while new backend services need richer routing. What is the safer transition?

ABridge edge telemetry to a tested AMQP backend path in stages
BReplace every field device before testing backend routes
CTreat MQTT topics and AMQP bindings as the same wire contract
DMove all traffic at once because both systems use equivalent delivery semantics.
Show answer

Answer: A A staged bridge preserves edge fit while backend routes are verified.

iotclass.org

Retrieval practice

Recall check 2 of 3

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

Q2Per this chapter's Common Misconception section, what is the key difference between MQTT QoS 2 and AMQP transactions?

AMQTT QoS 2 and AMQP transactions are functionally identical -- both roll back automatically on any processing failure
BAMQP transactions only guarantee delivery to the broker, while MQTT QoS 2 provides atomic commit/rollback across services
CNeither MQTT QoS 2 nor AMQP transactions offer any delivery guarantee; both require the application to implement retries manually
DMQTT QoS 2 blocks duplicate hop delivery; AMQP transactions group broker publishes/ACKs; neither makes external actions atomic.
Show answer

Answer: D MQTT QoS 2 prevents duplicate application-message delivery on its protocol hop.

iotclass.org

Retrieval practice

Recall check 3 of 3

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

Q3A fleet of 20,000 battery-constrained meters sends small periodic readings and needs no broker work queues at the device. A developer chooses AMQP 0-9-1 solely because it sounds like stronger QoS. Which listed concern should the design review raise?

AAMQP's frame and connection model add overhead without a device-side work-queue need.
BAMQP lacks all acknowledgments or reliability controls, unlike MQTT telemetry.
CMQTT cannot connect to cloud brokers, so 20,000 meters require AMQP instead.
DAMQP and MQTT have identical overhead across framing and connections.
Show answer

Answer: A The chapter's table gives a 2-byte MQTT minimum fixed header and an 8-byte AMQP 0-9-1 frame header.

iotclass.org

Print reference

Answers

Answer key.

  1. A · A staged bridge preserves edge fit while backend routes are verified.
  2. D · MQTT QoS 2 prevents duplicate application-message delivery on its protocol hop.
  3. A · The chapter's table gives a 2-byte MQTT minimum fixed header and an 8-byte AMQP 0-9-1 frame header.
iotclass.org