← All Learning Paths

Message Queue Developer

Build asynchronous backbones with queues: competing consumers, dead letters, idempotent processing, exactly-once trade-offs, and diagnosing lag before customers notice.

roleintermediate6 nodes12.83h total

Path overview

队列把同步世界的时间压力转换为异步世界的容量问题。本路径从消费者模型与死信语义出发,直面精确一次的工程真相,再用 BullMQ 与 Celery 两条主流栈落地,收尾于 Kafka 积压与 RabbitMQ 队列增长的实战诊断。

Queues convert synchronous latency into asynchronous capacity problems. This path covers consumer models, dead-letter semantics, the truth about exactly-once, BullMQ and Celery in practice, and real lag diagnosis.

  1. Compare "Model the job lifecycle" with "Enqueue atomically" in "How to Build a Job Queue with Backoff and Dead Letters" and state which trade-off you would accept in messaging code.

    Completion criteria: Record a short walkthrough of "How to Build a Job Queue with Backoff and Dead Letters" with timestamps at "Model the job lifecycle" and "Enqueue atomically", plus the commit that applies it.

    Next step: BullMQ

    ⏱ 1h

  2. Stand up "BullMQ" for a messaging task, confirm "new Queue new Queue(name: string, opts: QueueOptions): Queue" holds, and document one failure you triggered.

    Prerequisites: How to Build a Job Queue with Backoff and Dead Letters

    Completion criteria: Attach one successful call and one invalid call against "BullMQ", citing "new Queue new Queue(name: string, opts: QueueOptions): Queue" as the documented surface.

    Next step: Celery

    ⏱ 1h

  3. Call Celery() Celery(name, broker, backend): Celery from "Celery" and capture both a successful response and one validation error.

    Prerequisites: BullMQ

    Completion criteria: Attach the request, response, and error code from "Celery"; annotate which field caused the failure.

    Next step: Add a Dead-Letter Queue Policy

    ⏱ 1h

  4. Run "Keep a queue consumer moving when one message cannot be processed, while preserving the" from "Add a Dead-Letter Queue Policy" and confirm the documented result "The consumer receives a message at most five times before it moves to the DLQ.".

    Completion criteria: Deliver a transcript of "Add a Dead-Letter Queue Policy" with each step's command and observed state, ending at "Keep a queue consumer moving when one message cannot be processed, while preserving the".

    Next step: Route Exhausted Messages to a Dead Letter Queue

    ⏱ 0.5h

  5. In the "Message Queue Developer" path, implement "Route Exhausted Messages to a Dead Letter Queue" so JSON object: { messages: [{ id, attempts }], maxAttempts } yields {deadLettered:[m1,m3],retry:[m2]}, including the second sample's edge case.

    Prerequisites: Add a Dead-Letter Queue Policy

    Completion criteria: Attach the solution file for "Message Queue Developer", two passing sample runs, and one failing run whose error matches the contract.

    Next step: Capstone: Message Queue Developer

    ⏱ 0.33h

  6. Build "Build a Backpressure Queue Service" through its phases, keeping "Watermark monitor" independently testable.

    Prerequisites: Add a Dead-Letter Queue Policy, Route Exhausted Messages to a Dead Letter Queue

    Completion criteria: Run the project's test command for "Build a Backpressure Queue Service", paste the passing output, and attach the acceptance note for "Watermark monitor" with the test name.

    Next step: Run the capstone's tests, publish the repository, and demo it to a reviewer.

    ⏱ 4h