Pros and Cons of Kafka vs Rabbit MQ --- kafka 和 rabbitmq對比

Kafka and RabbitMQ are well know message brokers. I want to build a microservice with Spring Boot and it seems that Spring Cloud provides out of the box solutions for them as the defacto choices. I know a bit of the trayectory of RabbitMQ which has lot of support. Kafka belongs to Apache so it should be good. So whats the main goal difference between RabbitMQ and Kafka? Take in consideration this will be used with Spring Cloud. Please share your experiences and criteria. Thanks in advance.

kafka和rabbitmq都是很好的消息中間件。spring cloud 都爲他們提供了默認支持。它們主要的區別是什麼?

Three application level difference is:

  1. Kafka supports re-read of consumed messages while rabbitMQ not.
  2. Kafka supports ordering of messages in partition while rabbitMQ supports it with some constraint such as one exchange routing to the queue,one queue, one consumer to queue.
  3. Kafka is for fast in publishing data to partition than rabbitMQ.
三個應用層面的區別:
1.kafka支持消息重複消費,rabbitMq不支持;
2.kafka支持消息排序(一個topic內),rabbitmq在這方面有一些限制;
3.kafka發佈消息的速度更快;

I certainly wouldn’t consider Kafka as lightweight. Kafka relies on ZooKeeper so you’d need to throw ZooKeeper to your stack as well.

Kafka is pubsub but you could re-read messages. If you need to process large volumes of data, Kafka performs much better and its synergy with other big-data tools is a lot better. It specifically targets big data.

我不會把kafka作爲一個輕量級的使用;因爲kafka依賴zookeeper;
kafka是發佈訂閱模式,但可以重複消費;
如果你需要處理大量的數據,可以用kafka和其它大數據工具配合使用,這樣性能更高;
簡言之,kafka主要場景是大數據;

Kafka is more than just a pub/sub messaging platform. It also includes APIs for data integration (Kafka Connect) and stream processing (Kafka Streams). These higher level APIs make developers more productive versus using only lower level pub/sub messaging APIs.

Also Kafka has just added Exactly Once Semantics in June 2017 which is another differentiator.

kafka不僅僅是一個消息發佈訂閱平臺。他還包括數據集成和流式處理的api。這些高級的api能夠讓開發者更加高效。
另外,kafka在20176月添加了精確一次的語義;

To start with Kafka does more than what RabbitMQ does. Message broker is just one subset of Kafka but Kafka can also act as Message storage and Stream processing. Comparing just the Message broker part, again Kafka is more robust than RabbitMQ as it supports Replication (for availability) and partitioning (for scalability), Replay of messages (if needed to reprocess) and it is Pull based. RabbitMQ can be scalable by using multiple consumers for a given queue but again it is push based and you lose ordering among multiple consumers.

It all depends on the use case and your question doesn’t provide the use case and performance requirements to suggest one over other.

kafka不僅可以用做消息中間件,還可以作爲海量消息的存儲和流式處理。
因爲kafka支持多副本、支持分區(已水平擴展)、支持消息重複消費,基於pull模式,
所有它比rabbitmq(基於push模式)更加健壯。
rabbitmq可以通過增加消費者的方式來間接擴展,但這種方式很難實現多消費者之間消息的順序。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章