Messaging · Updated 2026-05-24

Kafka vs RabbitMQ

Kafka is the right choice when the log is the product: high throughput, replayable history, multiple consumers reading independently. RabbitMQ wins when the work is the product: complex routing, per-message acks, low-throughput priority queues.

PLATE — MESSAGING SHAPESKAFKA · LOGP0→ appendP1P2consumer A · offset 5consumer B · offset 2vsRABBITMQ · BROKERpubtopicordersemailsauditconsumer → ack → deleteREPLAYABLE LOG · ROUTED QUEUES
Apache Kafka
Distributed event log. Append-only, partitioned, replayable.
Since
2011
By
LinkedIn / Apache (Confluent commercial)
License
Apache 2.0
kafka.apache.org ↗
RabbitMQ
Traditional message broker with rich routing primitives.
Since
2007
By
Central / VMware / Broadcom
License
Mozilla Public License 2
www.rabbitmq.com ↗

These tools solve different problems even though both move messages. Kafka is a distributed commit log: producers append, consumers read at their own offset, the broker keeps everything for as long as configured. RabbitMQ is a queue server: producers enqueue, consumers dequeue, the broker keeps a message only until someone acks it. Picking the wrong shape forces ugly workarounds either way.

Quick takes

If you're…

  • You need to replay events from last week to backfill a new service Kafka Kafka stores by retention policy; consumers pick any offset. RabbitMQ deletes on ack.
  • You need a job queue with priorities, TTLs, and dead-letter exchanges RabbitMQ RabbitMQ ships these as primitives. Kafka makes you build them.
  • You need 1M+ messages/sec sustained on commodity hardware Kafka Kafka was designed for sequential disk throughput. RabbitMQ caps much sooner.
  • You need RPC-style request/reply with correlation IDs RabbitMQ RabbitMQ has direct-reply queues; Kafka requires a topic dance.
  • You need a single source of truth for downstream warehouses, search, cache Kafka Many consumers reading the same log at different speeds is Kafka's home turf.
  • You need per-message routing based on headers, content, or wildcards RabbitMQ AMQP exchanges (topic, headers, fanout) are first-class.
  • Your throughput is under 50K msg/sec and ops simplicity wins RabbitMQ RabbitMQ is one binary; Kafka needs ZooKeeper-or-KRaft and careful tuning.
  • You need exactly-once semantics across systems with transactional outbox Kafka Kafka transactions + idempotent producer are the cleaner primitive.
Decision wizard

A few questions, a verdict.

Q1

What is the dominant pattern?

Q2

What's the throughput target?

Q3

Do you need rich routing (priorities, headers, TTLs, DLQ)?

Q4

Operational tolerance?

At a glance

The scorecard.

Dimension
Kafka
RabbitMQ
Edge
Distributed commit log
Routing broker with queues
depends
Millions per second
Tens of thousands per second
Kafka
Retain by time/size, replay native
Ack-then-delete (Streams opt-in)
Kafka
Partition key only
Direct, topic, fanout, headers
RabbitMQ
Per-partition ordering
Per-queue FIFO
Kafka
At-least-once + transactional EOS
At-least-once + manual ack/confirm
Kafka
High (KRaft simplifies but still complex)
Lower (single binary, mgmt UI)
RabbitMQ
Streams, ksqlDB, Flink, Debezium
Integrations exist, not the focus
Kafka
In depth

Dimension by dimension.

core

Core abstraction

depends
Kafka

A distributed, append-only commit log. Topics are split into partitions, each an ordered immutable sequence. Consumers track their own offsets. The broker is a storage system more than a router.

RabbitMQ

A broker with queues fed by exchanges. Producers publish to exchanges, exchanges route to queues by binding rules, consumers pop from queues. Messages disappear on ack. The broker does the routing for you.

core

Throughput

edge: Kafka
Kafka

Designed for millions of messages per second per cluster. Sequential disk writes, zero-copy, batch compression. LinkedIn famously runs trillions per day.

RabbitMQ

Tens of thousands of messages per second per node. Beyond that, performance degrades — RabbitMQ Streams (a newer feature) closes the gap but is not the default.

features

Retention and replay

edge: Kafka
Kafka

Messages are retained for a configurable time or size, independent of consumption. A new consumer can read from offset 0 and rebuild state. The log is the system of record.

RabbitMQ

Messages live in the queue until acked. Once acked, they are gone. Replay requires a separate "store" or DLQ pattern. Streams (since 3.9) add log-style retention as an opt-in.

features

Routing primitives

edge: RabbitMQ
Kafka

Partition by key. That is the routing. Anything more complex (filtering, fan-out by header, content-based routing) is application code or a stream-processing layer like Kafka Streams or Flink.

RabbitMQ

Exchanges (direct, topic, fanout, headers) handle the dispatch. Bindings act as routing rules. You can route to dozens of queues from one publish, by pattern.

core

Ordering guarantees

edge: Kafka
Kafka

Strict ordering within a partition. Across partitions, no order. Choose your partition key with that in mind.

RabbitMQ

Strict FIFO per queue. Single-consumer ordered. Multi-consumer parallelism breaks order unless you set up consistent hashing.

features

Delivery semantics

edge: Kafka
Kafka

At-least-once by default; exactly-once with transactional producer + read_committed isolation. Mature outbox patterns built around it.

RabbitMQ

At-least-once with manual acks and publisher confirms. No transactional commit across consumers; "exactly-once" requires application-level idempotency.

ops

Operational complexity

edge: RabbitMQ
Kafka

High. Requires ZooKeeper (or KRaft mode since 3.5), JVM tuning, partition planning, rebalancing strategies. Confluent Cloud and AWS MSK exist to hide this.

RabbitMQ

Lower. Single Erlang binary, web management UI, clustering with mirrored queues or Quorum Queues. CloudAMQP and AWS MQ for managed.

ecosystem

Stream-processing ecosystem

edge: Kafka
Kafka

Kafka Streams, ksqlDB, Flink, Spark Structured Streaming, Materialize, Debezium for CDC. The richest set of stream-processing tools in software.

RabbitMQ

Thinner. Some integrations exist via Spring Cloud Stream and connectors, but stream processing is not the goal of the platform.

Benchmark

Sustained throughput, 1 KB messages, 3-node cluster

OpenMessaging Benchmark Framework (LinkedIn), c5n.4xlarge per broker, 1 KB messages, replication factor 3, durable producers. Numbers from the canonical 2020 study (still reproduced regularly).

Metric
Kafka
RabbitMQ
Better
Peak throughput (3 brokers)
Kafka was tuned at LinkedIn for this exact pattern.
605k msg/s
38k msg/s
Kafka
p99 latency (low load)
RabbitMQ wins on tail latency for small queues.
5 ms
1 ms
RabbitMQ
p99 latency (saturated)
RabbitMQ collapses past peak; Kafka degrades gracefully.
26 ms
720 ms
Kafka
Disk efficiency (msg/MB written)
Sequential append + batching.
850
240
Kafka

Source: OpenMessaging Benchmark Framework (Confluent / LinkedIn) ↗

Performance

Kafka vs RabbitMQ performance: what actually moves the numbers.

Throughput and latency are not one number each. They depend on workload shape, durability settings, and where the queue sits in your system.

The shape of the workload decides who looks fast. Kafka’s throughput comes from sequential appends, producer batching, and zero-copy reads — a continuous firehose of small messages is its best case, and it degrades gracefully as load climbs. RabbitMQ is the opposite profile: with short queues and moderate load its tail latency is excellent, often beating Kafka at p99, because messages pass through memory and rarely touch disk. Let queues grow deep, though, and RabbitMQ starts paging messages out, throughput drops, and latency goes from the best in the field to the worst. Kafka’s log does not care how far behind a consumer is.

The OpenMessaging benchmark cited above deserves a caveat: it measured sustained throughput and latency on three-broker clusters pushing 1 KB messages with replication factor 3 and durable producers. That is Kafka’s home game — a firehose with no routing. It did not measure topic-exchange fan-out, priority queues, per-message TTLs, or selective routing, which is the work RabbitMQ exists to do. A benchmark of those patterns would flatter RabbitMQ the way the firehose flatters Kafka.

Durability settings dominate the spread more than the engines do. A Kafka producer with acks=1 is answering a different question than one with acks=all and min.insync.replicas=2 — and Kafka famously trusts the OS page cache rather than fsyncing every message, while RabbitMQ’s quorum queues fsync before confirming. Comparing a loosely configured system against a strictly configured one measures the settings, not the software. Most published head-to-heads, including vendor ones, blur this line somewhere.

And most teams never reach territory where any of it matters. Below roughly 50K messages per second, either broker is loafing; the bottleneck is almost always the consumer — deserialization, the database write per message, the external API call. If your throughput target fits in that range, pick by shape (replay and fan-out versus routing and acks), not by benchmark deltas you will never get close to.

When to pick neither

A different shape of problem.

  • You want both — pub-sub and persistence — in one tiny binary
  • Redpanda
    Kafka-protocol-compatible, single binary, no JVM, low p99
  • Pulsar
    Geo-replication, tiered storage, multi-tenancy as primitives
  • AWS SQS / GCP Pub/Sub
    Cloud-native managed queue with zero ops
  • Redis Streams
    Light-touch streaming alongside an existing Redis cluster
  • NSQ
    Minimal, decentralized, no broker single-point-of-failure
Situational picks

For specific cases.

Event sourcing or change data capture for downstream consumers

Kafka

Replayable log, transactional producer, Debezium ecosystem. The canonical event-sourcing substrate.

Background job processing — emails, image resize, async work

RabbitMQ

Per-message acks, priorities, TTLs, dead-letter exchanges. Workers can be added or removed without partition rebalances.

Real-time analytics ingestion at hundreds of thousands of events/sec

Kafka

Kafka was built for this. Connect downstream to Flink, Materialize, ClickHouse, or a warehouse.

Microservice request/reply with correlation IDs

RabbitMQ

RabbitMQ's direct-reply queues handle this cleanly. Kafka can do it but the pattern is awkward.

You're a small team and operational simplicity wins

RabbitMQ

One binary, web UI, clear primitives. Kafka's ops surface is non-trivial even with KRaft.

You need both shapes — log AND queue — at scale

NATS JetStream or Redpanda

Both speak the streaming model with simpler ops than Kafka and more durability than RabbitMQ.

Sources

Primary material.

Found this useful?