📜  Apache Kafka与RabbitMQ

📅  最后修改于: 2021-01-05 03:02:52             🧑  作者: Mango

Apache Kafka与兔子MQ

什么是RabbitMQ?

RabbitMQ是使用最广泛的通用开放源消息代理。它于2007年发布,是消息传递系统的主要组件。当前,它用于流传输用例。 RabbitMQ能够处理后台任务或充当微服务之间的消息代理。它帮助Web应用程序减少了负载。而且,它减少了服务器的交付时间,以完成那些费时的任务或资源。

什么是Apache Kafka?

Apache Kafka还是一个开源的分布式发布/订阅消息系统。它于2011年发布,用作两个应用程序之间的中间存储。生产者将消息写入并存储在Kafka集群中。另一方面,使用者使用来自群集的消息。它还可以减少繁重消息的缓慢传递。

kafka vs.兔子MQ

”Apache

Parameters Apache Kafka RabbitMQ
Distribution Kafka consumers get distributed through topic partitions. Each consumer consumes messages from a specific partition at a time. There are a number of consumers present for each queue instance. These consumers are known as Competitive consumers as they compete with one another for consuming the message. But, the message can be processed just once.
High Availability With the help of zookeeper, it manages the state of the Kafka cluster and supports high availability. Through clustering and high available queues provides high-performance data replication. Thus, it also provides high availability.
Performance It can process millions of messages in a second with less number of the hardware. It can also process millions of messages within a second, but it needs more number of the hardware.
Replication There are replicated brokers available in Kafka, which works when the master broker is down. Here, queues are not automatically replicated. The configuration is mandatory.
Multi subscriber Multiple consumer types can subscribe to many messages to Kafka. Although messages are routed to various queues, only one consumer from a queue can process the message.
Message Protocols Apache Kafka supports primitives such as int8, int16, etc. and binary messages. This supports any standard queue protocols such as STOMP, AMQP, HTTP, etc.
Message Ordering Message ordering is present inside the partition only. It guarantees that either all fail or pass together. It maintains the order for flows via a single AMQP channel. In addition, it also reorders the retransmitted packets inside its queue logic that will prevent the consumer from resequencing the buffers.
Message lifetime It contains a log file that prevents all messages anytime. Since it is a queue, messages once consumed are removed, and the acknowledgment is received.
Architecture Highly scalable pub/sub distributed messaging system. It has brokers, topics, partitions, and topics within the Kafka cluster. A general-purpose pub/sub message broker. Its architecture varies from Kafka as it consists of queues.
Use Cases It is mainly used for streaming the data. The web servers mainly use it for immediate response to the requests.
Transactions It supports those transactions that exhibit a ?read-process-write? pattern performed to/from Kafka topics. It does not guarantee atomicity even when the transaction indulges only a single queue.
Language Apache Kafka is written in Scala with JVM. RabbitMQ is written in Erlang.
Routing Support It supports complex routing scenarios. It does not support complex routing scenarios.
Developer Experience With high growth, it led to a good experience. But, it only supports Java clients. RabbitMQ carries mature client libraries that support Java, PHP, Python, Ruby, and many more.