Untitled Lesson
Skill Matrix
UNLOCK NODES BY LEARNING NEW TAGS.
What is the key architectural difference between Kafka and a traditional message queue like RabbitMQ regarding what happens to a message after it's consumed?
💻 Code Challenge | +75 XP
Set up a Kafka producer publishing order events to an "order-events" topic, and two separate consumer groups (email-service and analytics-service) each independently receiving a full copy of every message.
A team chose RabbitMQ for a system that later needed a new analytics service to replay and reprocess the entire history of past events, which RabbitMQ's queue-based model doesn't naturally support. Reorder the steps to address this.
Task: Reorder the blocks in logical sequence to solve the problem.
A.D.A. Interface
Adaptive Didactic Assistant

Pascual Vila
Frontend Instructor // Code Syllabus
The Error //
Choosing a message broker based on popularity or familiarity rather than the actual access pattern needed
// Evaluate the actual need first:
// Simple task queue, complex routing rules needed? RabbitMQ fits naturally.
// Multiple independent readers need their own view + replay value? Kafka fits naturally.The Solution //
RabbitMQ and Kafka solve genuinely different problems well — RabbitMQ excels at traditional task-queue workloads with complex routing needs, while Kafka excels at high-throughput event streaming with multiple independent consumers and replay needs. Choosing based on which is more popular rather than which access pattern actually fits can lead to fighting the tool's natural model later.
The Error //
Writing a non-idempotent consumer against a message broker, assuming exactly-once delivery
// Wrong: assumes exactly-once, will eventually double-process
async function handleOrderEvent(message) { await chargeCard(message.amount); }
// Correct: idempotent, safe under at-least-once delivery
async function handleOrderEvent(message) {
if (await alreadyProcessed(message.id)) return;
await chargeCard(message.amount);
}The Solution //
Both RabbitMQ and Kafka provide at-least-once delivery by default, meaning a message can legitimately be delivered and processed more than once under certain failure scenarios (like a consumer crashing after processing but before acknowledging). A non-idempotent handler will eventually produce incorrect results when this occurs.