Differences between AMQP and ZeroMQ
Asked Answered
A

6

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?

Amundson answered 28/9, 2012 at 6:49 Comment(0)
N
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.

Nelson answered 1/10, 2012 at 6:36 Comment(6)
Would it be correct to say that ZeroMQ offers functionality similar to the Actor model of concurrenct/distributed computing?Amundson
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).Nelson
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: zeromq.org/topics:omq-is-just-sockets.Soniferous
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!!!Soniferous
-1 because (as mentioned in other answers and comments) this answer is dead wrong about 0MQ.Epencephalon
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.Williamswilliamsburg
S
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.

Soniferous answered 18/10, 2012 at 6:33 Comment(1)
That link is nothing short of propaganda for 0MQ.Jonathanjonathon
N
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.

Nelson answered 1/10, 2012 at 6:36 Comment(6)
Would it be correct to say that ZeroMQ offers functionality similar to the Actor model of concurrenct/distributed computing?Amundson
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).Nelson
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: zeromq.org/topics:omq-is-just-sockets.Soniferous
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!!!Soniferous
-1 because (as mentioned in other answers and comments) this answer is dead wrong about 0MQ.Epencephalon
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.Williamswilliamsburg
N
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.

Nelsen answered 13/1, 2013 at 23:13 Comment(0)
D
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/

Downall answered 30/9, 2012 at 21:31 Comment(0)
C
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.

Cullum answered 8/12, 2014 at 6:8 Comment(0)
L
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.

Leatri answered 15/12, 2016 at 13:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.