Show that events arrive twice, out of order, and sometimes not at all

applied · 75 min · Objective 5.6

Task

Build a fan-out and then test the three guarantees you do not have. Each one has a specific remedy, and a design that assumes ordering or exactly-once delivery fails in production in ways that are very hard to reproduce.

Steps

  1. Build a topic with two subscribers, each with its own queue. Publish 100 numbered events and confirm both subscribers receive all 100.
  2. ORDER: have one consumer record arrival order and compare against the published sequence. Introduce parallel consumers and record how many events arrive out of order in lab/events/guarantees.md.
  3. DUPLICATES: force redelivery by failing acknowledgement on some messages. Record the duplicate count, then add idempotent handling and confirm the end state is correct despite them.
  4. LOSS: make one consumer fail permanently on a specific event with no dead-letter queue configured, and record what happens to that event after retries expire. Then add a dead-letter queue and confirm it is preserved instead.
  5. Add a correlation identifier to every event and show one event's path across both subscribers, then write why tracing is not optional in an event-driven system.

Verify

grep -Eci 'out of order' lab/events/guarantees.md
grep -Eci 'duplicate' lab/events/guarantees.md
grep -Eci 'dead.letter' lab/events/guarantees.md
grep -Eci 'correlation' lab/events/guarantees.md
grep -Ec '[0-9]+' lab/events/guarantees.md

All five non-zero with counts recorded for each guarantee. The loss case must record the event being unrecoverable before the dead-letter queue existed -- that silence is the failure mode people do not anticipate.

This is an independent study companion for CompTIA Cloud+ CV0-004 and is not produced by or endorsed by CompTIA.