Learn Everything

Paths/Backend Engineer/Queues & Async Work / Queue & Consumer Design

Guided Taskbeginnerubuntu:24.04Ask AI

Design the Topic Layout

Topics are contracts with your own future self. Write the layout for the order events, with the key that keeps them ordered.

Validator

⏱ 0:00

IDLE — checks run live as you type commands; submit when done

01Requirements

live checks
  • Directory ~/backend/queues exists○
  • File ~/backend/queues/topics.yaml exists○
  • The config names the topics, their partitions and their retention○
  • The config states the key of every topic○

02Walkthrough

3 steps
  1. 01

    Write the topic layout

    One topic per event type. The key decides which partition the message lands in, and therefore the order you get.

    echo 'topics:\n - name: order.created\n partitions: 12\n key: order_id\n retention: 7d\n - name: payment.captured\n partitions: 12\n key: order_id\n retention: 30d' > ~/backend/queues/topics.yaml
  2. 02

    Verify the layout

    cat prints the layout. Check that the key is the same on every related topic.

    cat ~/backend/queues/topics.yaml
  3. 03

    Submit for validation

    The validator checks the topics, partitions, retention and key.

03Stuck?

0 of 3 revealed

Take a hint without losing the lab — each one points at the thing to look at, not at the answer.

04AI Tutor

guides, never solves

Tell me what you're stuck on — I'll nudge, not solve. Which requirement are you looking at?

04Notebook

saved locally in this browser

learner@lab — ubuntu:24.04

↑/↓ recalls commands · Ctrl+Enter submits · type help for the command list