我曾被要求评估RabbitMQ而不是Kafka,但发现很难找到一个消息队列比Kafka更适合的情况。有人知道在哪些用例中消息队列在吞吐量、持久性、延迟或易用性方面更适合吗?
当前回答
如果你有复杂的路由需求,想要一个内置的GUI来监控代理,那么RabbitMQ可能是最适合你的应用程序。否则,如果你正在寻找一个消息代理来处理高吞吐量并提供对流历史的访问,Kafka可能是更好的选择。
其他回答
你们忘记的一个关键区别是RabbitMQ是基于推的消息系统,而Kafka是基于拉的消息系统。这在消息传递系统必须满足具有不同处理能力的不同类型的消费者的场景中非常重要。使用基于Pull的系统,消费者可以根据自己的能力消费,而推送系统将推送消息,而不管消费者的状态如何,从而将消费者置于高风险之中。
我知道这是一个老问题了,但是在处理数据编校时RabbitMQ可能是一个更好的选择。
在RabbitMQ中,默认情况下,一旦消息被消费,它就会被删除。在Kafka中,默认情况下,消息保存一周。通常将这个时间设置为更长的时间,甚至永远不删除它们。
虽然这两个产品都可以配置为保留(或不保留)消息,但如果CCPA或GDPR合规性是一个问题,我会选择RabbitMQ。
我能想到的唯一好处是事务性功能,其余的都可以用Kafka来完成
Scaling both is hard in a distributed fault tolerant way but I'd make a case that it's much harder at massive scale with RabbitMQ. It's not trivial to understand Shovel, Federation, Mirrored Msg Queues, ACK, Mem issues, Fault tollerance etc. Not to say you won't also have specific issues with Zookeeper etc on Kafka but there are less moving parts to manage. That said, you get a Polyglot exchange with RMQ which you don't with Kafka. If you want streaming, use Kafka. If you want simple IoT or similar high volume packet delivery, use Kafka. It's about smart consumers. If you want msg flexibility and higher reliability with higher costs and possibly some complexity, use RMQ.
Apache Kafka is a popular choice for powering data pipelines. Apache kafka added kafka stream to support popular etl use cases. KSQL makes it simple to transform data within the pipeline, readying messages to cleanly land in another system. KSQL is the streaming SQL engine for Apache Kafka. It provides an easy-to-use yet powerful interactive SQL interface for stream processing on Kafka, without the need to write code in a programming language such as Java or Python. KSQL is scalable, elastic, fault-tolerant, and real-time. It supports a wide range of streaming operations, including data filtering, transformations, aggregations, joins, windowing, and sessionization.
https://docs.confluent.io/current/ksql/docs/index.html
对于etl系统来说,Rabbitmq并不是一个受欢迎的选择,它更适合那些需要简单的消息传递系统和更低吞吐量的系统。
推荐文章
- RabbitMQ / AMQP:单队列,同一消息的多个消费者?
- 从RabbitMQ中删除所有队列?
- RabbitMQ与通道和连接之间的关系
- 重新安装后无法访问RabbitMQ web管理界面
- 卡夫卡在控制台生产
- 删除芹菜/ rabbitmq中所有挂起的任务
- 在卡夫卡的作品中,有没有一种方法可以清除这个话题?
- 是什么决定了Kafka的消费抵消?
- 为什么我们需要像RabbitMQ这样的消息代理而不是像PostgreSQL这样的数据库?
- 消息队列vs. Web服务?
- 使用Kafka作为(CQRS)事件存储。好主意吗?
- 理解Kafka主题和分区
- 何时在Kafka上使用RabbitMQ ?
- ActiveMQ或RabbitMQ或ZeroMQ或