Message Queues
by @clawkk
Deep message queue workflow—queue vs topic, ordering and partitions, retries and DLQ, idempotency, backpressure, observability, and failure design. Use when...
clawhub install message-queues📖 About This Skill
name: message-queues description: Deep message queue workflow—queue vs topic, ordering and partitions, retries and DLQ, idempotency, backpressure, observability, and failure design. Use when integrating workers, event buses, or debugging poison messages and lag.
Message Queues (Deep Workflow)
Queues decouple producers and consumers—and introduce duplicates, ordering surprises, poison messages, and lag. Make delivery semantics and failure handling explicit.
When to Offer This Workflow
Trigger conditions:
Initial offer:
Use six stages: (1) delivery semantics, (2) topology & partitions, (3) message contract, (4) consumers & retries, (5) ops & scaling, (6) failure drills). Confirm cloud and ordering requirements.
Stage 1: Delivery Semantics
Goal: Choose at-most-once, at-least-once, or effective-once via idempotency.
Questions
1. Can duplicate processing break invariants? 2. Is ordering global, per-entity, or unnecessary? 3. Latency vs durability trade-offs
Exit condition: One paragraph per pipeline stating semantics.
Stage 2: Topology & Partitions
Goal: Throughput and ordering align—ordering only within partition when using Kafka-style partitions.
Practices
Stage 3: Message Contract
Goal: Versioned events or commands with schema registry.
Practices
Stage 4: Consumers & Retries
Goal: Exponential backoff + jitter; DLQ with reason; replay tooling owned.
Pitfalls
Stage 5: Ops & Scaling
Goal: Lag metrics, consumer offset health, rebalance awareness (Kafka).
Stage 6: Failure Drills
Goal: Kill consumer mid-batch; duplicate publish intentionally; validate idempotency.