ActiveMQ 或 RabbitMQ 或 ZeroMQ 或
我们有兴趣了解 ActiveMQ、RabbitMQ 和 ZeroMQ 的优缺点。 也欢迎有关任何其他有趣的消息队列的信息。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
我们有兴趣了解 ActiveMQ、RabbitMQ 和 ZeroMQ 的优缺点。 也欢迎有关任何其他有趣的消息队列的信息。
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(17)
编辑:我最初的回答主要关注 AMQP。 我决定重写它以提供对该主题更广泛的看法。
这 3 种消息传递技术在构建分布式系统方面有不同的方法:
RabbitMQ 是 AMQP 协议的领先实现之一(与 Apache Qpid 一起)。 因此,它实现了代理架构,这意味着消息在发送到客户端之前在中央节点上排队。 这种方法使 RabbitMQ 非常易于使用和部署,因为只需几行代码即可支持路由、负载平衡或持久消息队列等高级场景。 然而,它也使其可扩展性较差且“速度较慢”,因为中心节点增加了延迟并且消息信封相当大。
ZeroMq 是一种非常轻量级的消息传递系统,专为高吞吐量/低延迟场景(例如金融领域的场景)而设计。 Zmq 支持许多高级消息传递场景,但与 RabbitMQ 相反,您必须通过组合框架的各个部分(例如:套接字和设备)来自己实现其中大部分场景。 Zmq 非常灵活,但您必须研究大约 80 页的指南(其中我建议任何编写分布式系统的人(即使您不使用 Zmq)在能够执行比在 2 个对等点之间发送消息更复杂的操作之前阅读此书。
ActiveMQ 处于中间位置。 与 Zmq 一样,它可以使用代理和 P2P 拓扑进行部署。 与 RabbitMQ 一样,它更容易实现高级场景,但通常以原始性能为代价。 这是消息传递的瑞士军刀:-)。
最后,所有 3 个产品:
Edit: My initial answer had a strong focus on AMQP. I decided to rewrite it to offer a wider view on the topic.
These 3 messaging technologies have different approaches on building distributed systems :
RabbitMQ is one of the leading implementation of the AMQP protocol (along with Apache Qpid). Therefore, it implements a broker architecture, meaning that messages are queued on a central node before being sent to clients. This approach makes RabbitMQ very easy to use and deploy, because advanced scenarios like routing, load balancing or persistent message queuing are supported in just a few lines of code. However, it also makes it less scalable and “slower” because the central node adds latency and message envelopes are quite big.
ZeroMq is a very lightweight messaging system specially designed for high throughput/low latency scenarios like the one you can find in the financial world. Zmq supports many advanced messaging scenarios but contrary to RabbitMQ, you’ll have to implement most of them yourself by combining various pieces of the framework (e.g : sockets and devices). Zmq is very flexible but you’ll have to study the 80 pages or so of the guide (which I recommend reading for anybody writing distributed system, even if you don’t use Zmq) before being able to do anything more complicated than sending messages between 2 peers.
ActiveMQ is in the middle ground. Like Zmq, it can be deployed with both broker and P2P topologies. Like RabbitMQ, it’s easier to implement advanced scenarios but usually at the cost of raw performance. It’s the Swiss army knife of messaging :-).
Finally, all 3 products:
为什么您错过了 Sparrow、八哥,红隼 >、Amazon SQS、Beanstalkd,Kafka,IronMQ ?
消息队列服务器
消息队列服务器有多种语言可供选择:Erlang (RabbitMQ)、C (beanstalkd)、Ruby (Starling 或 Sparrow)、Scala (Kestrel、Kafka) 或 Java (ActiveMQ)。 找到简短概述
可以在此处 Sparrow
Starling
Kestrel
RabbitMQ
Apache ActiveMQ
ActiveMQ 是由 Philotic, Inc. 编写的 Java Beanstalkd
Amazon SQS
Kafka
ZMQ
EagleMQ
IronMQ
我希望这对我们有帮助。
来源
Why did you miss Sparrow, Starling, Kestrel, Amazon SQS, Beanstalkd, Kafka, IronMQ ?
Message Queue Servers
Message queue servers are available in various languages, Erlang (RabbitMQ), C (beanstalkd), Ruby (Starling or Sparrow), Scala (Kestrel, Kafka) or Java (ActiveMQ). A short overview can be found here
Sparrow
Starling
Kestrel
RabbitMQ
Apache ActiveMQ
Beanstalkd
Amazon SQS
Kafka
ZMQ
EagleMQ
IronMQ
I hope that this will be helpful for us.
source
比您想知道的更多信息:
http://wiki.secondlife.com/wiki/Message_Queue_Evaluation_Notes
更新
只是阐述保罗在评论中添加的内容。 上面提到的页面在 2010 年之后就已失效,所以请谨慎阅读。 三年内改变了很多东西。
More information than you would want to know:
http://wiki.secondlife.com/wiki/Message_Queue_Evaluation_Notes
UPDATE
Just elaborating what Paul added in comment. The page mentioned above is dead after 2010, so read with a pinch of salt. Lot of stuff has been been changed in 3 years.
这实际上取决于您的用例。
将 0MQ 与 ActiveMQ 或 RabbitMQ 进行比较是不公平的。
ActiveMQ 和 RabbitMQ 是需要安装和管理的消息系统。
他们提供的功能比 ZeroMQ 多得多。 它们有真正的持久队列、对事务的支持等。ZeroMQ
是一个轻量级的面向消息的套接字实现。 它也适合进程内异步编程。 可以通过 ZeroMQ 运行“企业消息系统”,但您必须自己实现很多工作。
所以:
ActiveMQ、RabbitMQ、Websphere MQ 等 MSMQ 是“企业消息队列”
ZeroMQ 是一个面向消息的 IPC 库。
It really depends on your use-case.
Comparing 0MQ with ActiveMQ or RabbitMQ is not fair.
ActiveMQ and RabbitMQ are Messaging Systems wich require installation and administration.
They offer featurewise a lot more than ZeroMQ. They have real persistent Queues, Support for transactions etc.
ZeroMQ is a lightweight message orientated socket implementation. It is also suitable for in-process asynchronous programming. It is possible to run a "Enterprise Messaging System" over ZeroMQ, but you would have to implement a lot on your own.
So:
ActiveMQ, RabbitMQ, Websphere MQ & MSMQ are "Enterprise Message Queues"
ZeroMQ is a message orientated IPC Library.
此处对 RabbitMQ 和 ActiveMQ 进行了比较。 ActiveMQ 开箱即用,配置为保证消息传递 - 与不太可靠的消息传递系统相比,这可能会给人缓慢的印象。 如果您愿意,您可以随时更改性能配置,并获得至少与任何其他消息传递系统一样好的性能。 至少你有这个选择。 论坛和 ActiveMQ 常见问题解答上有大量有关扩展、性能和高可用性配置的信息。 此外,当规范最终确定时,ActiveMQ 将支持 AMQP 1.0 以及其他传输格式,例如 STOMP。
ActiveMQ 的另一个优点是它是一个 Apache 项目,因此开发人员社区具有多样性 - 并且它不依赖于一家公司。
There's a comparison between RabbitMQ and ActiveMQ here. Out of the box, ActiveMQ is configured to guarantee message delivery - which can give the impression its slow compared to less reliable messaging systems. You can always change the configuration for performance if you wish and get at least as good performance as any other messaging system. At least you have that option. There's a lot of information on the forums and the ActiveMQ FAQ for configuration for scaling, performance and high availability. Also, ActiveMQ will support AMQP 1.0 when the spec is finalized, together with other wire formats, like STOMP.
Another plus for ActiveMQ is its an Apache project, so there is diversity in the developer community - and its not tied to one company.
我没有使用过ActiveMQ或RabbitMQ,但使用过ZeroMQ。 我认为 ZeroMQ 和 ActiveMQ 等之间的最大区别是 0MQ 是无代理的,并且没有内置的消息传递可靠性。 如果您正在寻找一个易于使用的消息传递 API,支持多种消息传递模式、传输、平台和语言绑定,那么 0MQ 绝对值得一看。 如果您正在寻找一个成熟的消息传递平台,那么 0MQ 可能不适合您。
有关如何使用 0MQ 的大量示例,请参阅 www.zeromq.org/docs:cookbook。
我成功地使用 0MQ 在用电监控应用程序中传递消息(请参阅 http://rwscott.co.uk/2010/06/14/currentcost-envi-cc128-part-1/)
I have not used ActiveMQ or RabbitMQ but have used ZeroMQ. The big difference as I see it between ZeroMQ and ActiveMQ etc. is that 0MQ is brokerless and does not have built in reliabilty for message delivery. If you are looking for an easy to use messaging API supporting many messaging patterns,transports, platforms and language bindings then 0MQ is definitely worth a look. If you are looking for a full blown messaging platform then 0MQ may not fit the bill.
See www.zeromq.org/docs:cookbook for plenty examples of how 0MQ can be used.
I an successfully using 0MQ for message passing in an electricity usage monitoring application (see http://rwscott.co.uk/2010/06/14/currentcost-envi-cc128-part-1/)
我正在使用zeroMQ。 我想要一个简单的消息传递系统,并且不需要代理的复杂性。 我也不想要一个庞大的面向Java的企业系统。
如果您想要一个快速、简单的系统并且需要支持多种语言(我使用 C 和 .net),那么我建议您考虑 0MQ。
I'm using zeroMQ. I wanted a simple message passing system and I don't need the complication of a broker. I also don't want a huge Java oriented enterprise system.
If you want a fast, simple system and you need to support multiple languages (I use C and .net) then I'd recommend looking at 0MQ.
关于 ActiveMQ,我只能补充 2 美分,但由于这是最流行的之一:
您想要编写的语言可能很重要。 尽管 ActiveMQ 确实有大多数客户端,但与 Java 库相比,它们的 C# 实现还远未完成。
这意味着一些基本功能是脆弱的(故障转移协议......嗯......在某些情况下失败,没有重新交付支持),而其他功能根本不存在。 由于.NET对于该项目似乎并不是那么重要,因此开发速度相当缓慢,并且似乎没有任何发布计划。 主干经常被破坏,所以如果你确实考虑到这一点,如果你想让事情继续进行,你可能需要考虑为该项目做出贡献。
然后是 ActiveMQ 本身,它有很多不错的功能,但也有一些非常奇怪的问题。 出于稳定性原因,我们使用 activemq 的 Fuse (Progress) 版本,但即便如此,您仍需要牢记一些奇怪的“错误”:
总而言之,如果您可以忍受它的问题:
A) 在使用 .NET 时不害怕积极参与
B) 用 java 开发;-)
I can only add my 2 cents about ActiveMQ but since this is one of the most popular:
The language you want to write in might be important. Although ActiveMQ does have a client for most, their C# implementation is far from complete compared to the Java Library.
This means some basic functionality is flaky (fail-over protocol that ... well ... fails in some cases, no redelivery support) and other simply isn't there. Since .NET doesn't seem to be all that important to the project, development is rather slowish and there doesn't seem to be any release plan. Trunk is often broken so if you do consider this, you might want to consider contributing to the project if you want things to go ahead.
Then there is ActiveMQ itself which has a lot of nice features but some very strange issues aswell. We use the Fuse (Progress) version of activemq for stability reasons but even then there are a couple of weird "bugs" that you want to keep in mind:
All and all, it is a pretty nice product IF you can live with its issues:
A) are not afraid to actively get involved when using .NET
B) develop in java ;-)
ZeroMQ真的是零队列! 这真是一个错误! 它没有队列、主题、持久性,什么都没有! 它只是套接字 API 的中间件。 如果这就是你看起来很酷的! 不然算了! 它不像 activeMQ 或rabbitmq。
ZeroMQ is really with zero queues! It is a really mistake! It does not hav queues, topics, persistence, nothing! It is only a middleware for sockets API. If it is what you are looking cool! otherwise forget it! it is not like activeMQ or rabbitmq.
RabbitMQ ActiveMQ 和 QPID 的功能和性能比较位于
http://bhavin.directi.com/rabbitmq-vs -apache-activemq-vs-apache-qpid/
我个人已经尝试了以上三个。 据我所知,RabbitMQ 是性能最好的,但它没有故障转移和恢复选项。 ActiveMQ 功能最多,但速度较慢。
更新 :
HornetQ 也是一个你可以研究的选项,它是 JMS Complaint,如果你正在寻找基于 JMS 的解决方案。
There is a comparison of the features and performance of RabbitMQ ActiveMQ and QPID given at
http://bhavin.directi.com/rabbitmq-vs-apache-activemq-vs-apache-qpid/
Personally I have tried all the above three. RabbitMQ is the best performance wise according to me, but it does not have failover and recovery options. ActiveMQ has the most features, but is slower.
Update :
HornetQ is also an option you can look into, it is JMS Complaint, a better option than ActiveMQ if you are looking for a JMS based solution.
我在这里写了关于 AMQP、Qpid 和 ZeroMQ 的初步经验: http://ron.shoutboot.com/2010/09/25/is-ampq-for-you/
我的主观意见是,如果您确实需要持久消息传递功能并且不太担心,AMQP 就很好。经纪人可能是一个瓶颈。 另外,AMQP 目前缺少 C++ 客户端(Qpid 没有赢得我的支持;但不确定 ActiveMQ 客户端),但可能正在开发中。 ZeroMQ 可能是另外一种方式。
I wrote about my initial experience regarding AMQP, Qpid and ZeroMQ here: http://ron.shoutboot.com/2010/09/25/is-ampq-for-you/
My subjective opinion is that AMQP is fine if you really need the persistent messaging facilities and is not too concerned that the broker may be a bottleneck. Also, C++ client is currently missing for AMQP (Qpid didn't win my support; not sure about the ActiveMQ client however), but maybe work in progress. ZeroMQ may be the way otherwise.
我已经在生产环境中使用 ActiveMQ 大约 3 年了。 虽然它完成了工作,但排列正常工作且无错误的客户端库版本可能是一个问题。 目前我们正在寻求过渡到 RabbitMQ。
I've used ActiveMQ in a production environment for about 3 years now. While it gets the job done, lining up versions of the client libraries that work properly and are bug free can be an issue. Were currently looking to transition to RabbitMQ.
这篇博文的评论中有一些讨论,关于 Twitter 编写自己的消息队列,这可能很有趣。
然而,你最初可能不会有类似 Twitter 的负载:)
There is some discussion in the comments of this blog post, about Twitter writing their own message queue, which may be interesting.
You probably won't have Twitter-like load initially however :)
很少有应用程序像 ActiveMQ 那样拥有如此多的调优配置。 ActiveMQ 脱颖而出的一些功能包括:
可配置的预取大小。
可配置的线程。
可配置的故障转移。
向生产者发出可配置的管理通知。
...
详细信息位于:
http://activemq.net/blog
http://activemq.apache.org
Few applications have as many tuning configurations as ActiveMQ. Some features that make ActiveMQ stand out are:
Configurable Prefetch size.
Configurable threading.
Configurable failover.
Configurable administrative notification to producers.
...
details at:
http://activemq.net/blog
http://activemq.apache.org
如果您也对商业实施感兴趣,您应该看看 my-channels 中的 Nirvana。
Nirvana 在金融服务行业中广泛用于大规模低延迟交易和价格分配平台。
支持跨企业、Web 和移动领域的多种客户端编程语言。
如果透明 HA 或负载平衡对您很重要,那么集群功能非常先进,值得一看。
Nirvana 可免费下载用于开发目的。
If you are also interested in commercial implementations, you should take a look at Nirvana from my-channels.
Nirvana is used heavily within the Financial Services industry for large scale low-latency trading and price distribution platforms.
There is support for a wide range of client programming languages across the enterprise, web and mobile domains.
The clustering capabilities are extremely advanced and worth a look if transparent HA or load balancing is important for you.
Nirvana is free to download for development purposes.
Abie,这一切都取决于您的用例。 不要依赖其他人对其用例的描述,请随意将您的用例发布到rabbitmq-讨论列表。 在 Twitter 上提问也会得到一些回复。 最美好的祝愿,亚历克西斯
Abie, it all comes down to your use case. Rather than relying on someone else's account of their use case, feel free to post your use case to the rabbitmq-discuss list. Asking on twitter will get you some responses too. Best wishes, alexis
关于 ZeroMQ 又名 0MQ,您可能已经知道,它每秒会为您获取最多的消息(我上次检查时,其参考服务器上的消息每秒约为 400 万条),但您可能也已经知道,文档不存在。 您将很难找到如何启动服务器,更不用说如何使用它们了。 我想这就是为什么还没有人为 0MQ 做出贡献的部分原因。
玩得开心!
About ZeroMQ aka 0MQ, as you might already know, it's the one that will get you the most messages per seconds (they were about 4 millions per sec on their ref server last time I checked), but as you might also already know, the documentation is non existent. You will have a hard time finding how to start the server(s), let alone how to use them. I guess that's partly why no one contributed about 0MQ yet.
Have fun!