AMQP · Study deck

AMQP Operations: Capacity Tools and Diagnostics

In production, AMQP carries work through a broker.

Broker Bex is your guide for this deck.

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

After studying this chapter

Learning objectives

You will be able to:

  • Explain: If the same channel keeps a window of 1,000 outstanding confirms, the theoretical pipe becomes roughly 1000 / 0.025 = 40,000 msg/s before broker, disk, and network limits.
  • Explain: It replicates contents with Raft across an odd number of nodes and keeps working while a majority is available; a publisher confirm means a quorum has accepted the message.
  • Explain: Production adds two harder requirements: the queue must survive a broker node failing, and the publisher must sustain thousands of messages per second without blocking on each confirm.
  • Use AMQP calculators to test load and capacity.
iotclass.org

Major section

Visual: AMQP Routing Topology

The view shows where routing flexibility lives and where backlog can accumulate.

  • It connects topology design to binding tests, queue monitoring, and unroutable-message policy.
  • This diagram shows how AMQP’s exchange-binding-queue model supports routing patterns distinct from MQTT topic subscriptions.
AMQP Routing Topology with exchanges, bindings, and queues
AMQP Routing Topology with exchanges, bindings, and queues
iotclass.org

Major section

Visual: AMQP Protocol Overview

This placement explains why availability, confirmation, persistence, acknowledgment, and monitoring must cover separate parts of the same path.

  • AMQP's broker-mediated architecture provides the reliable, transactional messaging capabilities required for enterprise IoT backend integration scenarios.
AMQP Protocol showing broker-mediated messaging
AMQP Protocol showing broker-mediated messaging
iotclass.org

Major section

Availability and Confirms

A durable disk file is not enough if no live member can keep serving the message.

  • A protocol is an agreed set of rules for an exchange: Advanced Message Queuing Protocol, or AMQP, is a protocol for exchanging messages.
  • A broker is the service that receives, routes, and holds those messages.
  • Practitioner sets up the queue and connection plan.

Key terms

Prefetch
Prefetch is applied per consumer in RabbitMQ; a sustained near-limit count can show saturated workers.

Why it matters

A three-node quorum queue can tolerate one broker node failing; if two nodes are unavailable, writes stop because no majority can confirm them.

Production monitoring follows the broker path: producers create load, bindings choose queues, queue depth stores backlog, and consumers determine drain rate.
Production monitoring follows the broker path: producers create load, bindings choose queues, queue depth stores backlog, and consumers determine drain rate.
iotclass.org

Major section

Availability and Confirms (continued)

For a critical queue, name how many members hold it, which loss it can survive, and what the sender learns about each accepted message.

  • Delay confirmations, refuse one message, and return one that has no valid route.
  • Track each message until it is confirmed, retried, rejected, or left unknown.
  • Everything so far makes a single broker correct.
iotclass.org

Major section

Availability and Confirms (continued)

This small test does not prove every high-load case.

  • Under the Hood tracks confirmation state at speed and explains the remaining loss windows.
  • AMQP Production Operations teaches durable declarations, client-library implementations, dead-letter queues, monitoring, and capacity calculators.
  • The two answers are replicated queues and asynchronous publisher confirms.
  • Connection hygiene has the same measurable shape.
iotclass.org

Major section

Availability and Confirms (continued)

Production adds two harder requirements: the queue must survive a broker node failing, and the publisher must sustain thousands of messages per second without blocking on each confirm.

  • A durable queue on one node is still a single point of failure; a synchronous "publish, wait for confirm, repeat" loop is safe but slow.
  • At the alert queue, 5% of 1,200 messages/s is 60 messages/s of ingress.
  • The throughput difference is large.
iotclass.org

Major section

Availability and Confirms (continued)

The three factories create 1,200 messages/s of ingress; exchange bindings determine how much of that rate reaches each queue, and every queue holds its own backlog.

  • It replicates contents with Raft across an odd number of nodes and keeps working while a majority is available; a publisher confirm means a quorum has accepted the message.
  • If each gateway opens a connection per message at 2 msg/s, the broker sees 1,000 TCP handshakes per second before it processes payloads.
  • With a quorum queue and successful confirms, this protects broker acceptance while allowing high throughput; the publisher need not block on each ack.
iotclass.org

Major section

Availability and Confirms (continued)

Prefetch is applied per consumer in RabbitMQ; a sustained near-limit count can show saturated workers.

  • So a robust publisher keeps a map of unconfirmed tags, removes them as acks arrive, resends on nack or unknown outcome with duplicate-safe IDs, and treats a returned message as a routing failure.
  • If the same channel keeps a window of 1,000 outstanding confirms, the theoretical pipe becomes roughly 1000 / 0.025 = 40,000 msg/s before broker, disk, and network limits.
  • Confirms protect accepted writes, queues reveal backlog, ACKs reveal consumer progress, and DLQs reveal work the normal path could not process.
iotclass.org

Deck summary

Key takeaways

The view shows where routing flexibility lives and where backlog can accumulate.

  • This placement explains why availability, confirmation, persistence, acknowledgment, and monitoring must cover separate parts of the same path.
  • A durable disk file is not enough if no live member can keep serving the message.
  • For a critical queue, name how many members hold it, which loss it can survive, and what the sender learns about each accepted message.
  • This small test does not prove every high-load case.
iotclass.org

Retrieval practice

Recall check 1 of 5

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

Q1The publisher reports success but a service queue stays empty. Which view should an operator inspect first?

AInspect consumer memory alone and assume it exposes routing bindings.
BInspect payload bytes alone without exchange or destination queue.
CView exchange, bindings, key and destination queue.
DCheck host clock alone as proof the routing key matched a queue.
Show answer

Answer: C The route can fail between accepted publish and queue copy.

Q2What routes and replicates queued work so a broker node failure need not lose accepted messages?

ABroker Cluster
BDevice Producers
CConsumer Services
Show answer

Answer: A The broker cluster applies routing, queues durable work, and replicates state so one node failure need not lose accepted messages.

iotclass.org

Retrieval practice

Recall check 2 of 5

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

Q3Complete the production AMQP consumer with prefetch control and error handling:

Ach.basic_nack(delivery_tag=method.delivery_tag, requeue=False)
Bch.basic_reject(delivery_tag=method.delivery_tag, requeue=True)
Cch.basic_ack(delivery_tag=method.delivery_tag)
Dch.basic_cancel(delivery_tag=method.delivery_tag)
Show answer

Answer: A basic_nack with requeue=False sends failed messages to the dead letter queue.

iotclass.org

Retrieval practice

Recall check 3 of 5

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

Q4Per this chapter's Overview section, which four thresholds does it say should be defined before a RabbitMQ release, to make the broker "observable as a production service"?

AMaximum CPU, disk, RAM and network usage as the four broker release alert limits
BMaximum exchange, binding, vhost and user counts instead of runtime backlog signals
CMaximum queue depth, oldest-message age, minimum active consumers and maximum unconfirmed publishes
DMaximum message, routing-key, binding-key and queue-name sizes as alert thresholds
Show answer

Answer: C see answers page

iotclass.org

Retrieval practice

Recall check 4 of 5

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

Q5Per this chapter's connection-hygiene worked example, what happens if 500 edge gateways each open a new connection per message instead of reusing a pooled publishing connection, at 2 messages/second per gateway?

A1,000 TCP handshakes/s for 500 gateways publishing twice; pooling saves setup.
BAbout 500 handshakes/s, because each gateway uses one connection for both publishes that second.
CAbout 500 connections, with the cost mainly idle sockets rather than per-message handshakes.
DExtra connections improve throughput because payloads run in parallel without setup cost.
Show answer

Answer: A see answers page

iotclass.org

Retrieval practice

Recall check 5 of 5

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

Q6A production publisher needs broker-node fault tolerance, high throughput, and visibility when a publish is unroutable. Which listed publisher-side combination best supports those goals?

AUse one classic queue and wait synchronously after every publish.
BUse auto-ack consumers while omitting all publisher confirms.
CUse quorum queues, asynchronous publisher confirms, and mandatory routing.
DUse a new connection per publish to isolate every node fault.
Show answer

Answer: C For the stated publisher-side goals, combine a replicated quorum queue with tracked asynchronous confirms and mandatory-return handling.

iotclass.org

Print reference

Answers 1 of 3

Answer key.

  1. C · The route can fail between accepted publish and queue copy.
  2. A · The broker cluster applies routing, queues durable work, and replicates state so one node failure need not lose accepted messages.
  3. A · basic_nack with requeue=False sends failed messages to the dead letter queue.
iotclass.org

Print reference

Answers 2 of 3

Answer key.

  1. C · The chapter's production observability rule is to define four thresholds before release -- max queue depth, max age of the oldest message, min active consumers, and max unconfirmed publishes -- so a queue that is 'already failing the product promise' (like a 90-second-old message against a 30-second SLA) is caught by an alert, not discovered after data loss.
iotclass.org

Print reference

Answers 3 of 3

Answer key.

  1. A · The chapter's connection-hygiene example: 500 gateways publishing at 2 msg/s each, if each opens a fresh connection per message, produces 1,000 TCP handshakes/second (500 x 2) before any payload is processed -- versus hundreds of stable, reused sockets if connections are pooled and channels reused per stream.
  2. C · For the stated publisher-side goals, combine a replicated quorum queue with tracked asynchronous confirms and mandatory-return handling.
iotclass.org