Help Center> Distributed Message Service> Service Overview> Differences Between Kafka and RabbitMQ
Updated on 2022-02-24 GMT+08:00

Differences Between Kafka and RabbitMQ

Kafka is pull-based and provides higher throughput. It is suitable for collecting and delivering large volumes of data, such as collecting and analyzing logs. RabbitMQ does not provide as high throughput as Kafka, but it offers more message queuing functions.

The following is a comparison analysis on the performance, data reliability, service availability, and functions of Kafka and RabbitMQ.

Performance

The performance of message-oriented middleware is measured by throughput. While RabbitMQ provides tens of thousands of QPS, Kafka provides millions.

However, if idempotency and transactions are enabled for Kafka, its performance will be compromised.

Data Reliability

Both Kafka and RabbitMQ provide the replication mechanism to ensure high data reliability.

Service Availability

Kafka runs in clusters and has partitions and replicas. Therefore, single-node failure does not affect services and the capacity of Kafka can be linearly scaled up.

The RabbitMQ service provided by HUAWEI CLOUD also supports clustered deployment.

Functions

Both Kafka and RabbitMQ are popular open-source message-oriented middleware. They differ mainly in the functions, which are listed in the following table.

Table 1 Function differences between Kafka and RabbitMQ

Function

Kafka 1.1.0

RabbitMQ 3.6.10

Priority queue

Not supported

Supported. It is recommended that the priority be set to 0–10.

Delayed queue

Not supported

Supported

Dead letter queue

Not supported

Supported

Retry

Not supported

Not supported

Retrieval mode

Pull-based

Pull-based and push-based

Message broadcasting

Supported

Supported

Message tracking

Supports offset and timestamp tracking.

Not supported. Once a message retrieval has been acknowledged, RabbitMQ will be notified that the message can be deleted.

Message accumulation

Supports higher accumulation performance than RabbitMQ thanks to high throughput.

Supported

Persistence

Supported

Supported

Message tracing

Not supported

Supported by the firehose feature or the rabbitmq_tracing plugin. However, rabbitmq_tracing reduces performance and should be used only for troubleshooting.

Message filtering

Supported

Not supported, but can be encapsulated.

Multi-tenancy

Not supported

Supported

Multi-protocol

Only Apache Kafka is supported.

RabbitMQ is based on AMQP and supports MQTT and STOMP.

Multi-language

Kafka is written in Scala and Java and supports clients in multiple programming languages.

RabbitMQ is written in Erlang and supports clients in multiple programming languages.

Throttling

Supports throttling on producer or consumer clients and users.

Supports credit-based throttling on producers, a mechanism that triggers protection from within.

Ordered message delivery

Supports partition-level FIFO.

Supports FIFO only for single-threaded message queuing without advanced features such as delayed queues or priority queues.

Security

Supports SSL and SASL authentication and read/write permissions control.

Similar to Kafka.

Idempotency

Supports idempotency for a single producer session.

Not supported

Transaction messages

Supported

Supported

The comparison is made between open-source Kafka and RabbitMQ.

DMS for Kafka and DMS for RabbitMQ maintain open-source compatibility while supporting or enhancing features in the open-source versions.