NodeAdvanced~3h

Message Queues

Count the deliveries, then stop counting

A queue redelivers on its own initiative — not because you retried, but because a broker cannot tell a dead consumer from a slow one. This is the volume on what follows: how many times your handler really runs, what a partition key costs, what a dead-letter threshold buys, and how to make the count stop mattering.

Modules
5
Drills
11
Build steps
3
Time
~3h

Walk out able to

Say how many times a handler runs under a stated acknowledgement mode and failure — then write the consumer that makes the answer irrelevant.

What you work on

01

One message, end to end

Producer, queue, consumer, and what an acknowledgement does.

02

The count that matters

How many times a handler runs, and why it is never once.

03

Ordering and its price

What a partition key buys, and the consumers it idles.

04

Dead letters, then done

Bounded retries, then an inbox that makes duplicates safe.

The pitch

What you practise, and what you leave with

A broker and two consumers in one file you run: the first applies fifteen effects for twelve messages, the second applies ten.

You will practise

  • Acknowledgement modes and what they redeliver
  • Counting handler runs under any failure
  • Ordering, partition keys and consumer groups
  • Dead letters, and inboxes that hold

Afterwards you can

  • Turn any described failure into an integer
  • Name the semantics you have, not the one you meant
  • Price a retry threshold before it ships
  • Build a consumer whose effects land once

Modules

5 modules, 17 items

Lessons explain one idea. Drills repeat it until it sticks. Build steps make something that exists afterwards.

  1. 1

    See the moving parts

    ~35 min

    Follow one message from send to acknowledgement and say what happens at every branch.

    • LessonWhy put a queue between them5 min
    • LessonFollow one message to its ack11 min
    • DrillSay what the broker does next9 min
    • DrillPick the shape the work needs10 min
  2. 2

    Count the handler runs

    ~33 min

    Turn any described failure into an integer, and hold a guarantee to its stated scope.

    • DrillCount the handler runs12 min
    • DrillName the semantics you have10 min
    • DrillHold the guarantee to its scope11 min
  3. 3

    Order costs parallelism

    ~20 min

    Say whether two messages are ordered at the handler, and what that guarantee cost.

    • DrillSay whether the order holds10 min
    • DrillCount the consumers that get work10 min
  4. 4

    Bound the retries

    ~21 min

    Run a stated dead-letter policy, and sort a failure before deciding to retry it.

    • DrillRun the dead-letter policy12 min
    • DrillSort the failure first9 min
  5. 5

    Make the count stop mattering

    ~1h

    Build a broker that redelivers, watch the duplicates land, and then make them harmless.

    • DrillDecide if the handler can repeat10 min
    • DrillPlace the dedup record11 min
    • Build stepBuild a broker that redelivers14 min
    • Build stepLet the failures in12 min
    • Build stepMake the duplicates harmless20 min
    • LessonRead five incidents cold20 min

The broker will hand it to you again. How many times?

The first item is free. ~3h of focused work, at your own pace.

Advanced~3h5 modules