ActiveMQ 或 RabbitMQ 或 ZeroMQ 或

发布于 2024-07-16 04:23:55 字数 69 浏览 8 评论 0 原文

我们有兴趣了解 ActiveMQ、RabbitMQ 和 ZeroMQ 的优缺点。 也欢迎有关任何其他有趣的消息队列的信息。

We'd be interested to hear any experiences with the pros and cons of ActiveMQ vs RabbitMQ vs ZeroMQ. Information about any other interesting message queues is also welcome.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(17

勿忘初心 2024-07-23 04:23:55

编辑:我最初的回答主要关注 AMQP。 我决定重写它以提供对该主题更广泛的看法。

这 3 种消息传递技术在构建分布式系统方面有不同的方法:

RabbitMQ 是 AMQP 协议的领先实现之一(与 Apache Qpid 一起)。 因此,它实现了代理架构,这意味着消息在发送到客户端之前在中央节点上排队。 这种方法使 RabbitMQ 非常易于使用和部署,因为只需几行代码即可支持路由、负载平衡或持久消息队列等高级场景。 然而,它也使其可扩展性较差且“速度较慢”,因为中心节点增加了延迟并且消息信封相当大。

ZeroMq 是一种非常轻量级的消息传递系统,专为高吞吐量/低延迟场景(例如金融领域的场景)而设计。 Zmq 支持许多高级消息传递场景,但与 RabbitMQ 相反,您必须通过组合框架的各个部分(例如:套接字和设备)来自己实现其中大部分场景。 Zmq 非常灵活,但您必须研究大约 80 页的指南(其中我建议任何编写分布式系统的人(即使您不使用 Zmq)在能够执行比在 2 个对等点之间发送消息更复杂的操作之前阅读此书。

ActiveMQ 处于中间位置。 与 Zmq 一样,它可以使用代理和 P2P 拓扑进行部署。 与 RabbitMQ 一样,它更容易实现高级场景,但通常以原始性能为代价。 这是消息传递的瑞士军刀:-)。

最后,所有 3 个产品:

  • 拥有适用于最常见语言(C++、Java、.Net、Python、Php、Ruby 等)的客户端 API
  • 拥有强大的文档
  • 得到积极支持

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:

  • have client apis for the most common languages (C++, Java, .Net, Python, Php, Ruby, …)
  • have strong documentation
  • are actively supported
九八野马 2024-07-23 04:23:55

为什么您错过了 Sparrow八哥红隼 >、Amazon SQSBeanstalkdKafkaIronMQ ?

消息队列服务器

消息队列服务器有多种语言可供选择:Erlang (RabbitMQ)、C (beanstalkd)、Ruby (Starling 或 Sparrow)、Scala (Kestrel、Kafka) 或 Java (ActiveMQ)。 找到简短概述

可以在此处 Sparrow

  • 由 Alex MacCaw Sparrow 编写,
  • 一个用 Ruby 编写的轻量级队列,“会说 memcache”

Starling

Kestrel

  • 由 Robey Pointer 编写
  • 用 Scala 编写的 Starling 克隆(Starling 从 Ruby 到 Scala 的端口)
  • 队列存储在内存中,但记录在磁盘上

RabbitMQ

  • 中的消息队列服务器
  • RabbitMQ 是 Erlang存储 内存中的作业(消息队列)

Apache ActiveMQ

  • 开源消息代理,

ActiveMQ 是由 Philotic, Inc. 编写的 Java Beanstalkd

Amazon SQS

Kafka

  • 用Scala 在 LinkedIn 上编写
  • 由 LinkedIn 用于卸载所有页面和其他视图的处理
  • 默认使用持久性,使用操作系统磁盘缓存来存储热数据(具有更高的吞吐量) 消息
  • 支持在线和离线处理

ZMQ

  • 充当并发框架的套接字库
  • 比 TCP 更快,适用于集群产品和超级计算
  • 跨 inproc、IPC 传送 、TCP 和多播
  • 通过扇出、发布订阅、管道、请求回复
  • 异步 I/O 连接 N-to-N,用于可扩展的多核消息传递应用程序

EagleMQ

  • EagleMQ 是一个开源、高性能、轻量级的队列管理器。
  • 用C编写
  • 将所有数据存储在内存中并支持持久化。
  • 它有自己的协议。 支持队列、路由和通道的工作。

IronMQ

  • IronMQ
  • 用 Go 编写
  • 完全托管的队列服务
  • 可作为云版本和本地版本使用

我希望这对我们有帮助。
来源

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

  • written by Alex MacCaw
  • Sparrow is a lightweight queue written in Ruby that “speaks memcache”

Starling

Kestrel

  • written by Robey Pointer
  • Starling clone written in Scala (a port of Starling from Ruby to Scala)
  • Queues are stored in memory, but logged on disk

RabbitMQ

  • RabbitMQ is a Message Queue Server in Erlang
  • stores jobs in memory (message queue)

Apache ActiveMQ

  • ActiveMQ is an open source message broker in Java

Beanstalkd

Amazon SQS

Kafka

  • Written at LinkedIn in Scala
  • Used by LinkedIn to offload processing of all page and other views
  • Defaults to using persistence, uses OS disk cache for hot data (has higher throughput then any of the above having persistence enabled)
  • Supports both on-line as off-line processing

ZMQ

  • The socket library that acts as a concurrency framework
  • Faster than TCP, for clustered products and supercomputing
  • Carries messages across inproc, IPC, TCP, and multicast
  • Connect N-to-N via fanout, pubsub, pipeline, request-reply
  • Asynch I/O for scalable multicore message-passing apps

EagleMQ

  • EagleMQ is an open source, high-performance and lightweight queue manager.
  • Written in C
  • Stores all data in memory and support persistence.
  • It has its own protocol. Supports work with queues, routes and channels.

IronMQ

  • IronMQ
  • Written in Go
  • Fully managed queue service
  • Available both as cloud version and on-premise

I hope that this will be helpful for us.
source

爱给你人给你 2024-07-23 04:23:55

比您想知道的更多信息:

http://wiki.secondlife.com/wiki/Message_Queue_Evaluation_Notes


更新

只是阐述保罗在评论中添加的内容。 上面提到的页面在 2010 年之后就已失效,所以请谨慎阅读。 三年内改变了很多东西。

Wiki 页面历史

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.

History of Wiki Page

挥剑断情 2024-07-23 04:23:55

这实际上取决于您的用例。

将 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.

七禾 2024-07-23 04:23:55

此处对 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.

你丑哭了我 2024-07-23 04:23:55

我没有使用过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/)

阪姬 2024-07-23 04:23:55

我正在使用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.

听风吹 2024-07-23 04:23:55

关于 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:

  • Brokers that stop sending messages in some occasions
  • Journal Errors making the queue show messages that are not there anymore (they don't get delivered to the consumer but still)
  • Priority is still not implemented (is on the Issues list since the start of human kind)
  • etc. etc.

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 ;-)

别低头,皇冠会掉 2024-07-23 04:23:55

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.

莫多说 2024-07-23 04:23:55

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.

祁梦 2024-07-23 04:23:55

我在这里写了关于 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.

寄人书 2024-07-23 04:23:55

我已经在生产环境中使用 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.

弱骨蛰伏 2024-07-23 04:23:55

这篇博文的评论中有一些讨论,关于 Twitter 编写自己的消息队列,这可能很有趣。

史蒂夫承担了巨大的负荷和压力
ActiveMQ、RabbitMQ等测试
ActiveMQ 实际上相当慢(很多
比 Kestrel 慢)、RabbitMQ
总是因太多而崩溃
生产者和消费者太少。

然而,你最初可能不会有类似 Twitter 的负载:)

There is some discussion in the comments of this blog post, about Twitter writing their own message queue, which may be interesting.

Steve did extensive load and stress
testing of ActiveMQ, RabbitMQ, etc.
ActiveMQ is actually quite slow (much
slower than Kestrel), RabbitMQ
consistently crashes with too many
producers and too few consumers.

You probably won't have Twitter-like load initially however :)

霊感 2024-07-23 04:23:55

很少有应用程序像 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

匿名的好友 2024-07-23 04:23:55

如果您也对商业实施感兴趣,您应该看看 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.

吃素的狼 2024-07-23 04:23:55

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

瀟灑尐姊 2024-07-23 04:23:55

关于 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!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文