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.
  • Configurable persistence decides whether that stored work survives a broker restart; it does not make processing successful.
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.
AMQP queues separate producer timing from consumer timing, while persistence and dead-letter routing define what survives delay or failure.
AMQP queues separate producer timing from consumer timing, while persistence and dead-letter routing define what survives delay or failure.
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 5

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

Q1Per this chapter's illustrative 2,500-truck cost model, AMQP's annual cellular cost is $12,600 and MQTT's modeled total is $35,676. Recomputing from the assumed monthly figures ($0.42/truck AMQP, $0.3892/truck MQTT cellular, plus MQTT's assumed $24,000/year broker license), why does AMQP have the lower modeled total despite its higher per-message overhead?

AAMQP cellular cost is zero with free broker software, so licensing cannot affect total cost.
BThe $24,000 MQTT license outweighs AMQP’s $924/year extra cellular cost under the model.
CMQTT licensing is free and its extra cellular overhead alone reaches $24,000/year.
DTreat both protocols as equal cost after licenses, because the modeled license difference is offset by operating costs.
Show answer

Answer: B see answers page

iotclass.org

Retrieval practice

Recall check 2 of 5

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

Q2What scopes the AMQP channel that multiplexes links over one connection?

AConnection (OPEN/CLOSE)
BLink (ATTACH/DETACH)
CTransfer (TRANSFER/DISPOSITION)
DSession (BEGIN/END)
Show answer

Answer: D BEGIN and END scope a session channel used to multiplex links over one connection.

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 5

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

Q4A 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?

AAMQP 1.0 leaves flow control entirely to application code.
BThe 0-9-1 basic.qos frame applies unchanged in AMQP 1.0.
CA durable queue length cap controls every in-flight delivery.
DReceiver-granted link credit caps transfers in AMQP 1.0.
Show answer

Answer: D see answers page

iotclass.org

Retrieval practice

Recall check 4 of 5

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

Q5A sender has link credit but transfers still stop. What should the trace inspect next?

AInspect the application queue name alone, because its value determines link and session flow grants.
BInspect TCP socket size alone rather than AMQP session flow state.
CInspect session flow window and unsettled state when link credit remains.
DInspect consumer logs only after transfers reach their destination.
Show answer

Answer: C Session flow can stop a link that still has credit.

iotclass.org

Retrieval practice

Recall check 5 of 5

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

Q6A valve command must be retried if acceptance is uncertain. Which settlement choice fits?

ARetry with no command identity or duplicate check
BKeep unsettled until accepted; make repeats safe.
CPre-settle the transfer and forget whether it arrives
DTreat a sent frame as proof the valve moved
Show answer

Answer: B Acceptance can be retried, while the app guards against duplicate action.

iotclass.org

Print reference

Answers 1 of 3

Answer key.

  1. B · Under the chapter's illustrative proportional-tariff assumption, AMQP's extra cellular cost is $924/year (2,500 trucks x $0.0308/truck/month x 12), while the assumed MQTT broker license costs $24,000/year; the modeled totals are $12,600 for AMQP cellular and $35,676 for MQTT cellular plus license.
  2. D · BEGIN and END scope a session channel used to multiplex links over one connection.
iotclass.org

Print reference

Answers 2 of 3

Answer key.

  1. A · AMQP connections use PlainCredentials for SASL PLAIN authentication and SSLOptions wrapping an SSLContext for TLS encryption on port 5671.
  2. D · AMQP 1.0 receivers grant link credit in FLOW frames; senders consume that credit with transfers. Session flow windows can impose a further limit. This differs from AMQP 0-9-1 basic.qos prefetch, which bounds broker deliveries to a consumer. Neither flow-control setting alone proves that the application processed a message exactly once.
iotclass.org

Print reference

Answers 3 of 3

Answer key.

  1. C · Session flow can stop a link that still has credit.
  2. B · Acceptance can be retried, while the app guards against duplicate action.
iotclass.org