ActiveMQ or RabbitMQ or ZeroMQ or [closed]
Asked Answered
A

17

643

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.

Atwitter answered 8/4, 2009 at 18:26 Comment(2)
I'm new to message queue and was reading more about real use case of it at https://mcmap.net/q/65080/-real-world-use-of-jms-message-queues-closed/181870. Later while googling for topics/articles related to message queue (JMS in particular), I came across OpenJMS - an open source implementation of Sun Microsystems's Java Message Service API 1.1 Specification. What I'm surprised is that it is not covered/discussed here? I just wanted to check with the community whether OpenJMS is related to this topic/discussion and if so, as per OP, any experiences with pros and cons of the same would help.Deflective
3 years later, a note for people browsing through here ... think about WHY you want to use message-queueing middleware. If the reason is to distribute tasks within a cluster, look at Celery. It operates at a higher level of abstraction than MQ-style solutions, uses RabbitMQ to move messages, but has outstanding support for task-specific semantics.Biller
P
342

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
Pappas answered 6/11, 2009 at 13:46 Comment(6)
While true, I am not sure if adoption of AMQP has strong correlation with the original question. I would think there are more important considerations for one's choice of a message queue than what underlying wire protocol it uses.Aspectual
The question doesn't mention requiring AMQP, but this answer is focused on AMQP. If we were to assume JMS as a requirement then the answer would basically be the reverse: ActiveMQ is most popular, RabbitMQ has some support that should probably work. If no wire protocol assumed: see other answers.Dextrocular
Having worked in RabbitMQ and ActiveMQ I would recommend you stay away from ActiveMQ. The releases are very buggy, and I had no end of problems with machines going down and memory leaks etc... RabbitMQ on the other hand just works. After I plugged it in I've NEVER had to look at it again. It just does what it needs to. If you like I have a simple RabbitMQ tutorial on my blog jarloo.com/rabbitmq-c-tutorialMaller
After looking at the job posts for RabbitMQ versus ActiveMQ, RabbitMQ seems to be much more in demand. ActiveMQ has been around longer but it's being requested by employers nearly as much.Gutter
The guide for ZMQ is also really a funny and good read :)Sudarium
Being implemented with the awesome Erlang, RabbitMQ central broker node (which is in fact a conceptual one) not necessarily be hosted into a single erlang node or server, instead can be a cluster of distributed nodes backed by (optionally depending your need) load balancers. So, IMO the scalability issue with RMQ's broker node you've specified is quite misleading and you should revise your answer in that part. My strong recommendation would be to not look RMQ only as a piece of ready software, instead a well written set of tools that can be customized for any kind of MQ need with ease.Intransigent
E
174

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

Epos answered 18/3, 2011 at 9:17 Comment(3)
Do you've any idea/thought to add/comment for my question asked in this question's comment area here - #731733?Deflective
Do they have contention management? I always found this issue with queue systems. For example blocking a producer if the queue is full based on number of elements (not on memory resources).Antevert
queues.io -- Mind to add details missing there vs. here.Bejewel
P
82

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

Pink answered 8/4, 2009 at 20:46 Comment(3)
I think these guys are thinking about queues wrong--queues shouldn't be 1 (or more) per user. They should be putting their work in a few queues and then utilizing. inboxes (or mboxes) for each user.Mertz
Michael -- want to elaborate a little more? The problem is real-time delivery in a group chat based system. If I'm understanding correctly, you're talking about a durable storage mechanism for messages as an endpoint (inbox)? If so, then it doesn't fit the bill, they want chat to be delivered immediately, and clients to be direct subscribers? As far as I can tell having a ton of topic based queues is not an optimized use case?Liatrice
Update: That SecondLife wiki page was written in 2009. By now, in 2013, many of the specific points mentioned about the different message queues they investigated are no longer current, due to ongoing improvements in all the MQs. Most or all of the MQs they tested are better, in some sense, by now.Adele
C
71

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.

Coloring answered 2/2, 2011 at 19:6 Comment(1)
You can use more than one. rabbitmq.com/blog/2010/10/18/rabbitmq0mq-bridge talks about how you can use 0MQ to bridge between several RabbitMQ brokers and create a loosely coupled federation.Arciniega
F
34

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.

Flagman answered 20/10, 2009 at 17:26 Comment(0)
B
22

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

Brainwork answered 24/8, 2010 at 7:28 Comment(0)
K
14

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.

Kirschner answered 28/7, 2010 at 16:18 Comment(1)
Also using ZMQ in C/C++ environment. Very fast. Using the broker pattern. A good fit for our real-time VOIP watch-dog app doing micro-pmts for farms of kamailio SIP servers. Pretty sure I could write a very sophisticated broker using ZMQ, but would evaluate some additional products before committing to that.Rugged
C
10

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

Crete answered 29/10, 2009 at 9:47 Comment(1)
Minor Update: Since a while, KahaDB is the default persistence store for ActiveMQ. However: it is not stable at all. In our testing, we have seen database corruptions (some restorable, others costing us roughly 15.000.000 messages) BEWARE OF THISCrete
M
8

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.

Marchese answered 19/8, 2010 at 14:49 Comment(0)
H
8

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.

Hesitation answered 23/8, 2010 at 11:5 Comment(0)
E
6

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.

Erasme answered 25/9, 2010 at 20:13 Comment(0)
M
6

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.

Maller answered 14/5, 2011 at 18:12 Comment(0)
S
5

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

Shaft answered 8/4, 2009 at 20:33 Comment(0)
D
5

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

Deibel answered 20/7, 2010 at 19:17 Comment(0)
J
1

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.

Johst answered 28/7, 2010 at 8:20 Comment(1)
This should have had a disclaimer that it's a promotion from a my-channels employee.Codi
S
0

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

Selection answered 18/5, 2009 at 13:7 Comment(0)
P
0

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!

Patel answered 15/5, 2010 at 3:6 Comment(2)
There are examples in the cookbook zeromq.org/docs:cookbook and there is a manual api.zeromq.org/zmq.html.Kirschner
while zmq is fast and have an easy api, keep in mind this: no persistence, no transactions. No detection of falied or slow consumers (messages simply get dropped without any notification to the producer program). Sidenote: zmq is serverless, so you won't find docs for starting the servers. They do have a proxy server if you have need for something like that though.Metts

© 2022 - 2024 — McMap. All rights reserved.