RabbitMQ vs Kafka: choosing honestly

RabbitMQ Course · lesson 14 of 15 · 6 min read

A broker that routes and forgets versus a log that retains - the difference decides the choice.

Open this lesson in the learning hub

Key points

  • RabbitMQ routes in the broker and deletes on ack; Kafka appends to a log the consumer reads by offset.
  • Kafka has no exchange, no binding and no routing key match, so filtering is the job of the consumer.
  • Retry is per message in RabbitMQ, while a Kafka offset moves a whole partition, so replays are ranges.
  • A RabbitMQ queue is empty once acked, whereas Kafka keeps data by time or size and can replay it.
  • Kafka consumer parallelism is capped by partition count; a RabbitMQ queue takes more consumers freely.
  • RabbitMQ Streams, added in 3.9, put a replayable log inside RabbitMQ and close part of that gap.

Pick RabbitMQ for routing and per-message control, Kafka for volume and replay - the storage model is the deciding factor.

This is a reading copy. The full lesson — with the visual explainer, the interactive lab and a Run button for the code — lives in the RabbitMQ Course course, and every lesson in it is listed on the RabbitMQ Course contents page.