Video in progress
What is the main difference between RabbitMQ and Kafka, and when do you pick each?
RabbitMQ / Kafka — Model: push, the broker delivers / pull, the consumer fetches; After the ack: the message is deleted / stays according to retention; Routing: exchanges: direct, topic, fanout, headers / only topic + partition; Ordering: within a queue, but parallel consumers break it / strict within a partition…
📖 Answer
| RabbitMQ | Kafka | |
|---|---|---|
| Model | push, the broker delivers | pull, the consumer fetches |
| After the ack | the message is deleted | stays according to retention |
| Routing | exchanges: direct, topic, fanout, headers | only topic + partition |
| Ordering | within a queue, but parallel consumers break it | strict within a partition |
| Replay | no (except streams) | by moving the offset, as much as you want |
| TTL, priority on a message | yes | no |
I'd choose RabbitMQ for: background tasks (generating a PDF, email) where each message needs its own ack/retry, complex routing, delayed messages.
Kafka for: high-volume events, one event read by many services, event sourcing, CDC, stream processing.
One more thing: RabbitMQ got Streams in 3.9, a log similar to Kafka's. The boundaries have blurred a bit, but the core difference in philosophy remains.
Sign up to mark studied questions and save your progress.