Integration & Gateways · Study deck
Practice: Message Queue Challenges
A freezer gateway loses its uplink while temperature messages keep arriving every ten seconds.
Gateway Gus is your guide for this deck.
After studying this chapter
Learning objectives
You will be able to:
- diagnose the five queue failure shapes (expiry, dead letters, duplication, ordering, backpressure) from evidence
- distinguish at-most-once, at-least-once, and exactly-once delivery semantics
- size a deduplication window against replay behavior, not message rate
- choose safe circuit-breaker states and resume conditions for a stuck queue
Major section
A Longer Line Does Not Fix a Stuck Message
The waiting line grows.
- Making it longer hides the delay but does not fix the cause.
- A larger store may help a short burst, but it cannot make unsafe replay safe.
- In the “ingress”–“message id + ttl” decision, use the same stops to locate evidence and assign the recheck.
Major section
Read the Failure Route Before Replaying
The split protects later messages from a poison record, but the dead-letter queue is not a bin to forget.
- It needs the original payload, failure reason, attempt count, and enough identity to repair or reject the message.
- Replaying before the defect is fixed merely sends the same poison message around the loop again.
- If the queue limit is 100 records, 20 records cannot fit.
Major section
Read the Failure Route Before Replaying (continued)
A sensor publishes one 240-byte record every 10 s, or six records each minute.
- During a 20-minute uplink loss, the gateway receives (6 \times 20=120) records.
- With ordered single-message processing, that record can block positions 38 through 120 if the consumer retries forever.
- On restart, the queue may redeliver that record.
Major section
Read the Failure Route Before Replaying (continued)
A screenshot of an empty queue proves none of those states by itself.
- The lab must state whether the oldest 20 are dropped, the newest 20 are rejected, or acquisition is slowed; an unspecified overflow policy is already a failure.
- If a counter differs, stop and explain the queue transition rather than adjusting the expected answer after the run.
- Any unexplained remainder is a message whose fate the queue evidence cannot show.
Major section
Read the Failure Route Before Replaying (continued)
The lab is complete only when normal traffic, overflow, poison-message isolation, and replay each have an observed result.
- This challenge separates transport completion from application completion and reveals whether at-least-once behavior is safe for the chosen message.
- End by reconciling counts: produced records equal acknowledged records plus queued, dead-lettered, and explicitly dropped records.
- New live records and replayed old records now compete for the consumer.
Major section
Summary
Queue challenges are reliability problems, not sizing problems; a bigger buffer postpones the symptom and hides whether the cause is a burst, a slow consumer, or a stuck message.
- Expiry bounds stale work with a time-to-live, but only helps when expiry is recorded and the consumer checks freshness before applying side effects.
Deck summary
Key takeaways
The waiting line grows.
- The split protects later messages from a poison record, but the dead-letter queue is not a bin to forget.
- A sensor publishes one 240-byte record every 10 s, or six records each minute.
- A screenshot of an empty queue proves none of those states by itself.
- The lab is complete only when normal traffic, overflow, poison-message isolation, and replay each have an observed result.
Retrieval practice
Recall check 1 of 4

Gateway Gus says: answer from memory, then check your reasoning.
Q1A gateway queue keeps growing during an outage recovery. An engineer proposes simply increasing the maximum queue size. Why is that often the wrong first move?
Show answer
Answer: B Queue challenges are reliability problems.
Retrieval practice
Recall check 2 of 4

Gateway Gus says: answer from memory, then check your reasoning.
Q2A queue's oldest-message age keeps rising while CPU and network use stay normal, and a subset of messages fail with the same validation error on every retry. What is the best next action?
Show answer
Answer: A Repeated validation failures are poison messages causing head-of-line blocking.
Retrieval practice
Recall check 3 of 4

Gateway Gus says: answer from memory, then check your reasoning.
Q3A queue consumer keeps failing. When should its circuit breaker resume normal delivery?
Show answer
Answer: D Successful trial work shows recovery before the full load returns.
Retrieval practice
Recall check 4 of 4

Gateway Gus says: answer from memory, then check your reasoning.
Q4An at-least-once path sizes its deduplication cache from the average message rate. Operators replay several hours of old messages after an outage and observe duplicated side effects. What is the root cause?
Show answer
Answer: D A dedup window must cover the worst-case retry-and-replay horizon, not the average rate; otherwise late duplicates fall outside the window and are reprocessed.
Print reference
Answers
Answer key.
- B · Queue challenges are reliability problems.
- A · Repeated validation failures are poison messages causing head-of-line blocking.
- D · Successful trial work shows recovery before the full load returns.
- D · A dedup window must cover the worst-case retry-and-replay horizon, not the average rate; otherwise late duplicates fall outside the window and are reprocessed.