AMQP · Study deck

AMQP Frames: Storage and Throughput Calculations

Picture a freezer sending an alarm to a duty team.

Broker Bex is your guide for this deck.

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

After studying this chapter

Learning objectives

You will be able to:

  • Test putting numbers to it with a concrete scenario and pass criteria.
  • Define amqp 1.0 credit and settlement contracts with explicit inputs, errors, and change rules.
  • Explain why AMQP 1.0 is not a newer wire-compatible version of AMQP 0-9-1.
  • Map AMQP 0-9-1 channels, publishing, prefetch, and acknowledgments to AMQP 1.0 sessions, links, credit, transfers, and dispositions.
iotclass.org

Major section

AMQP Architecture Diagrams

These visual references provide alternative perspectives on AMQP architecture and frame concepts.

  • Broker acceptance, routing, and consumer completion occur at different boundaries, so each needs its own evidence.
  • Persistence, ordering, prefetch, and acknowledgments remain separate policies; the picture connects those policies to the production checks developed later.
AMQP message flow follows a well-defined path from producer through the broker's routing engine to consumers. The exchange evaluates bindings to determine destination queues, enabling flexible one-to-many and many-to-one messaging patterns essential for IoT data aggregation and distribution.
AMQP message flow follows a well-defined path from producer through the broker's routing engine to consumers. The exchange evaluates bindings to determine destination queues, enabling flexible one-to-many and many-to-one messaging patterns essential for IoT data aggregation and distribution.
iotclass.org

Major section

AMQP 1.0 Credit and Settlement Contracts

A connection can stay open even when one direction has no room to move.

  • The useful question is which delivery stopped, why it stopped, and what state each side recorded.
  • AMQP means Advanced Message Queuing Protocol.
  • A protocol is a shared set of message and state rules.
  • For IoT gateways, this affects failure isolation.

Key terms

Telemetry
Telemetry means measurements and status sent from a remote device for review.

Why it matters

Telemetry might keep 200 messages in flight because each sample is small and replaceable; commands might grant only one or two credits so the device handles each command deliberately.

Settlement mode is the reliability switch: it decides whether a delivery is fire-and-forget, retried until accepted, or coordinated with two-phase settlement on the link.
Settlement mode is the reliability switch: it decides whether a delivery is fire-and-forget, retried until accepted, or coordinated with two-phase settlement on the link.
iotclass.org

Major section

AMQP 1.0 Credit and Settlement Contracts (continued)

This runway does not choose a settlement mode for every workload.

  • A broker is a service that accepts and routes messages.
  • A gateway is the device or service that joins two system paths.
  • Telemetry means measurements and status sent from a remote device for review.
iotclass.org

Major section

AMQP 1.0 Credit and Settlement Contracts (continued)

The 1.0 model nests three scopes: a connection carries one or more sessions, and each session carries one or more links.

  • Reachability alone does not prove that a valve acted once.
  • The difference shows up most clearly when you read the frames.
  • AMQP 1.0 flow control is credit-based and receiver-driven.
iotclass.org

Major section

AMQP 1.0 Credit and Settlement Contracts (continued)

A link is unidirectional and has a role -- a sender link or a receiver link -- attached between a source and a target terminus.

  • AMQP 1.0 (the OASIS/ISO standard) deliberately does not: it standardises only the symmetric, peer-to-peer transfer of messages between two nodes and leaves routing to whatever broker or peer sits behind an address.
  • A published message is then split into a method frame, a content header frame with properties and body size, and one or more body frames.
  • This makes back-pressure explicit -- a slow consumer simply stops granting credit.
iotclass.org

Major section

AMQP 1.0 Credit and Settlement Contracts (continued)

In 1.0, the wire vocabulary is more abstract: peers open a connection, begin a session, attach sender or receiver links, exchange flow credit, transfer message sections, and settle deliveries with dispositions.

  • Messages travel as transfer frames along a link; the frames the chapter listed above (open, begin, attach, flow, transfer, disposition) are just the lifecycle of setting up and using those scopes.
  • A RabbitMQ 0-9-1 producer might publish telemetry to a topic exchange with a routing key, where bindings choose the queue.
  • The growing handshake reduces ambiguity on the link but adds state and latency.
iotclass.org

Major section

AMQP 1.0 Credit and Settlement Contracts (continued)

An AMQP 1.0 producer instead attaches a sender link to an address; the broker decides what that address means.

  • A sender may not push at will: the receiver issues link credit in a flow frame, and the sender can emit only that many transfer frames before it must wait for more.
  • The sender can place 25 deliveries on that link and then must stop until another flow frame grants more credit.
  • If the receiver processes 10 messages and grants 10 more credits, the sender gets room for 10 additional transfers without changing the TCP connection or creating a new link.
iotclass.org

Deck summary

Key takeaways

These visual references provide alternative perspectives on AMQP architecture and frame concepts.

  • A connection can stay open even when one direction has no room to move.
  • This runway does not choose a settlement mode for every workload.
  • The 1.0 model nests three scopes: a connection carries one or more sessions, and each session carries one or more links.
  • A link is unidirectional and has a role -- a sender link or a receiver link -- attached between a source and a target terminus.
iotclass.org

Retrieval practice

Recall check 1 of 4

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

Q1Per this chapter's TransCargo case study, the AMQP annual total cost is $12,600 versus MQTT's $33,300 for the 2,500-truck fleet. Recomputing from the chapter's own per-truck monthly figures ($0.42/truck AMQP, $0.31/truck MQTT cellular, plus MQTT's $24,000/year broker license), why does AMQP win despite its higher per-message overhead?

AThe $24,000/year MQTT enterprise license cost far outweighs AMQP's extra cellular overhead (2,500 trucks x $0.11/truck/month x 12 = $3,300/year)
BAMQP has zero cellular cost because it uses free broker software
CMQTT's license is free but its cellular overhead costs $24,000/year alone
DAMQP and MQTT have identical total costs once license fees are included
Show answer

Answer: A

iotclass.org

Retrieval practice

Recall check 2 of 4

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

Q2Place each AMQP performative at its lifecycle boundary so you can diagnose whether a failure belongs to the peer, channel, link, or delivery state.

AConnection (OPEN/CLOSE)
BSession (BEGIN/END)
CLink (ATTACH/DETACH)
DTransfer (TRANSFER/DISPOSITION)
Show answer

Answer: A Place each AMQP performative at its lifecycle boundary so you can diagnose whether a failure belongs to the peer, channel, link, or delivery state.

Q3Complete the AMQP connection setup with SASL PLAIN authentication and TLS encryption:

Acredentials = pika.PlainCredentials('iot_user', 'secure_pass')
Bcredentials = pika.BasicAuth('iot_user', 'secure_pass')
Ccredentials = pika.SASLCredentials('iot_user', 'secure_pass')
Dcredentials = pika.TokenCredentials('iot_user', 'secure_pass')
Show answer

Answer: A AMQP connections use PlainCredentials for SASL PLAIN authentication and SSLOptions wrapping an SSLContext for TLS encryption on port 5671.

iotclass.org

Retrieval practice

Recall check 3 of 4

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

Q4Per the chapter's Overview section, why can Azure Service Bus, ActiveMQ, and Qpid all interoperate over AMQP 1.0 despite having very different broker internals?

AAMQP 1.0 standardises only the peer-to-peer transfer of messages between two nodes and leaves routing to whatever broker sits behind an address, unlike AMQP 0-9-1 which bakes the exchange/queue/binding model into the protocol
BAMQP 1.0 is a newer, wire-compatible version of AMQP 0-9-1 that all three vendors implement identically
CAll three brokers use RabbitMQ's exchange, queue, and binding model internally
DAMQP 1.0 defines a single mandatory routing algorithm that every broker must use
Show answer

Answer: A

iotclass.org

Retrieval practice

Recall check 4 of 4

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

Q5A team migrating from RabbitMQ (AMQP 0-9-1) to an AMQP 1.0 broker asks how a consumer limits how many messages it receives at once. What is the accurate answer?

AReceiver-granted link credit limits transfers.
BAMQP 1.0 has no flow control, so consumers must throttle themselves in application code.
CYou set basic.qos prefetch exactly as in 0-9-1, because the frame types are identical.
DYou declare a durable queue with x-max-length to cap in-flight messages.
Show answer

Answer: A AMQP 1.0 uses receiver-granted link credit for flow control and settlement modes (accepted/rejected/released/modified) to select at-most-once, at-least-once, or exactly-once.

iotclass.org

Print reference

Answers

Answer key.

  1. A
  2. A · Place each AMQP performative at its lifecycle boundary so you can diagnose whether a failure belongs to the peer, channel, link, or delivery state.
  3. A · AMQP connections use PlainCredentials for SASL PLAIN authentication and SSLOptions wrapping an SSLContext for TLS encryption on port 5671.
  4. A
  5. A · AMQP 1.0 uses receiver-granted link credit for flow control and settlement modes (accepted/rejected/released/modified) to select at-most-once, at-least-once, or exactly-once.
iotclass.org