27

Recently started looking into these AMQP (RabbitMQ, ActiveMQ) and ZeroMQ technologies, being interested in distributed systems/computation. Been Googling and StackOverflow'ing around, couldn't find a definite comparison between the two.

The farthest I got is that the two aren't really comparable, but I want to know the differences. It seems to me ZeroMQ is more decentralized (no message broker playing middle-man handling messages/guarenteering delivery) and as such is faster, but is not meant to be a fully fledged system but something to be handled more programmatically, something like Actors.

AMQP on the other hand seems to be a more fully fledged system, with a central message broker ensuring reliable delivery, but slower than ZeroMQ because of this. However, the central broker creates a single point of failure.

Perhaps a metaphor would be client/server vs. P2P?

Are my findings true? Also, what would be the advantages, disadvantages, or use cases of using one over the other? A comparison of the uses of *MQ vs. something like Akka Actors would be nice as well.

EDIT Did a bit more looking around.. ZeroMQ seems to be the new contender to AMQP, seems to be much faster, only issue would be adoption/implementations?

adelbertc
  • 7,270
  • 11
  • 47
  • 70

6 Answers6

22

Here's a fairly detailed comparison of AMQP and 0MQ: http://www.zeromq.org/docs:welcome-from-amqp

Note that 0MQ is also a protocol (ZMTP) with several implementations, and a community.

Pieter Hintjens
  • 6,599
  • 1
  • 24
  • 29
15

AMQP is a protocol. ZeroMQ is a messaging library.

AMQP offers flow control and reliable delivery. It defines standard but extensible meta-data for messages (e.g. reply-to, time-to-live, plus any application defined headers). ZeroMQ simply provides message delimitation (i.e. breaking a byte stream up into atomic units), and assumes the properties of the underlying protocol (e.g. TCP) are sufficient or that the application will build extra functionality for flow control, reliability or whatever on top of ZeroMQ.

Although earlier versions of AMQP were defined along client/server lines and therefore required a broker, that is no longer true of AMQP 1.0 which at its core is a symmetric, peer-to-peer protocol. Rules for intermediaries (such as brokers) are layered on top of that. The link from Alexis comparing brokered and brokerless gives a good description of the benefits such intermediaries can offer. AMQP defines the rules for interoperability between different components - clients, 'smart clients', brokers, bridges, routers etc - such that a system can be composed by selecting the parts that are useful.

Gordon Sim
  • 256
  • 1
  • 2
  • Would it be correct to say that ZeroMQ offers functionality similar to the Actor model of concurrenct/distributed computing? – adelbertc Oct 01 '12 at 17:32
  • I wouldn't myself put it in quite those terms. The Actor model is a different abstraction from the socket interface that ZeroMQ presents. However, the Actor model is based on message passing so you could implement that model on top of ZeroMQ (or almost any other message passing technology). – Gordon Sim Oct 02 '12 at 13:50
  • 1
    Gordon, "ZeroMQ simply provides message delimitation (i.e. breaking a byte stream up into atomic units)" is deeply inaccurate. Where did you get this idea from? It's a parody: http://www.zeromq.org/topics:omq-is-just-sockets. – Pieter Hintjens Oct 18 '12 at 06:58
  • 17
    For those who can't be bothered to click that link, the punchline is: APART FROM portability, message framing, super fast asynchronous I/O, support for every bloody language anyone cares about, huge community, price tag of zero, mind-blowing performance, protection from memory overflows, loads of internal consistency checks, patterns like pub/sub and request/reply, batching, and seamless support for inter-thread transport as well as TCP and multicast, ZEROMQ IS JUST SOCKETS!!! – Pieter Hintjens Oct 18 '12 at 07:02
  • 1
    -1 because (as mentioned in other answers and comments) this answer is dead wrong about 0MQ. – Marek Mar 11 '14 at 22:16
  • I'm generally for zeromq, as it makes socket so much easier to work with, and allowing the focus on the business logic rather than low level networking. And as more and more usage of it, i slowly took all the goodies for granted, and start wondering is there functionally downsides compared to socket, such as not guaranteed message delivery. – liang Apr 18 '14 at 06:37
7

In ZeroMQ there are NO MESSAGE QUEUES at all, thus the name. It merely provides a way to use messaging semantics over otherwise ordinary sockets.

AMQP is standard protocol for message queueing which is meant to be used with a message-broker handling all message sends and receives. It has a lot of features which are available because it funnels all message traffic through a broker. This may sound slow, but it is actually quite fast when used inside a data centre where host to host latencies are tiny.

Michael Dillon
  • 31,973
  • 6
  • 70
  • 106
2

I'm not really sure how to respond to your question, which is comparing a lot of different things... but see this which may help you begin to dig into these issues: http://www.rabbitmq.com/blog/2010/09/22/broker-vs-brokerless/

alexis
  • 409
  • 2
  • 2
1

AMQP (Advanced Message Queuing Protocol) is a standard binary wire level protocol that enables conforming client applications to communicate with conforming messaging middleware brokers. AMQP allows cross platform services/systems between different enterprises or within the enterprise to easily exchange messages between each other regardless of the message broker vendor and platform. There are many brokers that have implemented the AMQP protocol like RabbitMQ, Apache QPid, Apache Apollo etc.

ZeroMQ is a high-performance asynchronous messaging library aimed at use in scalable distributed or concurrent applications. It provides a message queue, but unlike message-oriented middleware, a ØMQ system can run without a dedicated message broker.

java_geek
  • 17,585
  • 30
  • 91
  • 113
1

Broker-less is a misnomer as compared to message brokers like ActiveMQ, QPid, Kafka for simple wiring.

It is useful and can be applied to hotspots to reduce network hops and hence latency, as we add reliability, store and forward feature and high availability requirements, you probably need a distributed broker service along with a queue for sharing data to support a loose coupling - decoupled in time - this topology and architecture can be implemented using ZeroMQ, you have to consider your use cases and see, if asynchronous messaging is required and if so, where ZeroMQ would fit, it has a good role in solution it appears and a reasonable knowledge of TCP/IP and socket programming would help you appreciate all others like ZeroMQ, AMQP, etc.

user3666197
  • 1
  • 6
  • 50
  • 92
Sram
  • 11
  • 1