4 ms·
My answer, as someone who recently switched an AMQP backend to using redis for queues and pub/sub broadcast: AMQP is wrong the same way RDBMSes or Java are "wro
by jamwt 16y ago
My answer, as someone who recently switched an AMQP backend to using redis for queues and pub/sub broadcast: AMQP is wrong the same way RDBMSes or Java are "wrong." It's too heavy, too slow, or too complex for a great-many use cases.
There's a long tradition that seems to be (mercifully) fading of ornately engineered solutions being developed for the most demanding of problem domains, and then subsequently being universally adopted for projects large and small because if "it's good enough for the enterprise, it's good enough for me". It's a variation of the "nobody ever got fired..." mentality.
The truth is that something with a radically reduced feature set, that's simpler to use and understand, is really all that's needed to meet a whole lot of "real world" use cases.
Read the AMQP-0.8 spec sometime. It's rather complex given that a _huge_ percentage of users just want a set of features something like:
1. A namespace to name queues
2. The ability to put things on and pull things off in FIFO order
3. The ability to persist those things on daemon start/stop (maybe)
4. Pub/sub style broadcast behavior with lossy messaging (maybe)
So redis, as an example: antirez (half-accidentally) got a lot of attention from weary queueing-system wanderers by implementing a majority of these capabilities with just a few redis commands--(l,r)push and (l,r)pop. Redis was so close to a simple, but full replacement for what they actually do with ActiveMQ, Rabbit, etc, that they begged for B(L,R)POP on many keys and PUB/SUB. And that pretty much covers it.
Of course, redis is just one of a number of other project/protocols are stealing attention from AMQP systems, like ZeroMQ, beanstalkd, etc.
But the larger trend is like Linux::"UNIX", Ruby::Java, MongoDB::Postgres, etc. Despite the hell-and-damnation warnings often bandied about by the enterprisey experts, you really can build a wide array of very useful things using these "toy" tools.
- aaronblohowiak 16y agoDon't throw out ActiveMQ if you want a lightweight solution -- just use it's STOMP support. STOMP is great, it is "enterprise compliant", but lightweight and very easy to understand. I am also a fan of redis and its pub/sub features, but using STOMP on ActiveMQ will let the complexity of your messaging infrastructure grow along with your needs. Evetually need persistence? flip a switch. Need a CBR or other ESB features? Start turning them on.
- sandGorgon 16y agoseconded. I think every messaging broker needs to support the STOMP protocol now. It is cross-language and a whole lot of products are being built around the protocol, including some that wean you away from JMS (e.g.HornetQ, previously known as JBoss Messaging Server)
- aaronblohowiak 16y agoShould be noted that there are also ruby and node.js STOMP clients
- foobarbazetc 16y agoIf your AMQP broker is slow, you're using the wrong broker. We do something like 1.2 million cluster durable messages per second through RHM on Intel SSDs. Once you add all the necessary stuff to your hacky ZeroMQ/Redis/beanstalkd implementation, you'll end up with a poorly designed implementation of a decent AMQP broker. If you don't need persistance, durability or clustering, then by all means, use whatever works for you.
- aaronblohowiak 16y agois RHM MRG?