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可以通过增加消费者的方式来间接扩展,但这种方式很难实现多消费者之间消息的顺序。

你可能感兴趣的:(后端开发)