Questions tagged [zeromq]

ZeroMQ (ZMQ, 0MQ, ØMQ) is a high-performance, asynchronous, transport-class agnostic, messaging library, aimed at use in scalable, distributed and/or concurrent applications. It provides a message queue, but unlike message-oriented middleware, a ZeroMQ system can run without a dedicated message broker. License: LGPL with static linking exception

ZeroMQ (Zero Message Queue) is a high-performance, asynchronous, transport-class agnostic messaging library, aimed to use in scalable distributed or concurrent applications. It provides a set of paradigms, similar to a message queue, but unlike message-oriented middleware, a ZeroMQ system operates without any dedicated, central / singular message-handling broker. Instead of that, several Scalable Formal Communication Patterns are provided as a particular communication archetype, serving as prototypes to create smart, more complex messaging / signalling planes, used for inter-connecting a distributed system.

The library is designed to have a familiar socket-style API and supports many transport-classes, incl. { inproc:// | ipc:// | tipc:// | vmci:// | tcp:// | pgm:// | epgm:// | udp:// }.

A more recent extension allows to use also the norm:// reliable multicast and unicast protocol, so far at least for (X)PUB/(X)SUB Scalable Formal Communications Pattern Archetypes.

ZeroMQ is developed by iMatix Corporation together with a large community of contributors. There are third-party bindings for almost every popular programming languages, from , ,,,, to , and many more.

ZeroMQ (also spelled ØMQ, 0MQ or ZMQ)


The basic ZeroMQ patterns join many-to-many topologies of distributed-agents, where specific message-handling behaviours ( aka Scalable Formal Communication Pattern Archetypes ) take place:

REQ / REP : the Request–Reply archetype

Connects a set of clients to a set of services. This is a remote procedure call and task distribution pattern.

PUB / SUB : the Publish–Subscribe archetype

Connects a set of publishers to a set of subscribers. This is a data distribution pattern.

PUSH / PULL : the Push–Pull (pipeline) archetype

Connects nodes in a fan-out / fan-in pattern that can have multiple steps, and loops. This is a parallel task distribution and collection pattern.

PAIR / PAIR Exclusive pair

Connects two sockets in an exclusive pair. (This is an advanced low-level pattern for specific use cases.)

ROUTER / DEALER formerly also known as XREQ / XREP archetype

XPUB / XSUB archetype extends the classical PUB/SUB archetype with adding also the application-level access to the subscription-management events.


Useful links:

You can get more information in the following sites:

3306 questions
22
votes
1 answer

WHY / WHEN using rather DDS instead of ZeroMQ?

I read the followings: DDS vs AMQP vs ZeroMQ http://mnb.ociweb.com/mnb/MiddlewareNewsBrief-201004.html And it seems that there is no benfit using DDS instead of zmq: the latency of zmq is better. It seem to me that the API of ZMQ is cleared and…
user3668129
  • 4,318
  • 6
  • 45
  • 87
22
votes
1 answer

How to check whether python package is installed or not in Docker?

I used Dockerfile successfully built a container. However, my code doesn't work in the container. It does work if I install all the packages manually. I'm assuming I messed up something that cause docker didn't install the packages properly. So, I…
Bruce Yong Li
  • 1,186
  • 1
  • 10
  • 20
22
votes
1 answer

is latency and throughput in AWS SNS good enough to replace dedicated MQ for pub/sub?

For a sake of HA I'm considering switching from self hosted solution (ZeroMQ) to AWS Simple Notification Service for pub/sub in an application. Which is a backend for an app, thus should be reasonably real-time. What are latency and throughput I…
vartec
  • 131,205
  • 36
  • 218
  • 244
22
votes
1 answer

ZeroMQ and multiple subscribe filters in Python

I'd like to subscribe to multiple filters with ZeroMQ in Python, using one socket. sock.setsockopt(zmq.SUBSCRIBE, 'first.filter') sock.setsockopt(zmq.SUBSCRIBE, 'second.filter') But this doesn't work. Only the first one is taken in account.…
Marc
  • 1,340
  • 2
  • 14
  • 23
21
votes
3 answers

Python + ZMQ: Operation cannot be accomplished in current state

I am trying to get a python program to communicate with another python program via zeromq by using the request-reply pattern. The client program should send a request to the server program which replies. I have two servers such that when one server…
QuikProBroNa
  • 796
  • 2
  • 7
  • 25
21
votes
3 answers

Understanding zeromq java binding

I'm investigating zeromq as a message passing solution in a java project, but I find the instructions on java binding somewhat difficult to follow. http://www.zeromq.org/bindings:java I am unfamiliar with java bindings, so these may be stupid…
Alex Pritchard
  • 4,260
  • 5
  • 33
  • 48
20
votes
3 answers

0MQ: How to use ZeroMQ in a threadsafe manner?

I read the ZeroMq guide and I stumbled upon the following: You MUST NOT share ØMQ sockets between threads. ØMQ sockets are not threadsafe. Technically it's possible to do this, but it demands semaphores, locks, or mutexes. This will make…
tobsen
  • 5,328
  • 3
  • 34
  • 51
20
votes
3 answers

How does zeromq work together with SSL?

I am considerung to use zeromq as messaging layer between my applications. At least in some cases I want the communication to be secure and I am thinking about SSL. Is there some standard way how to ssl-enable zeromq? As far as I understand it…
newtogit
  • 201
  • 1
  • 2
  • 3
20
votes
6 answers

How should a ZeroMQ worker safely "hang up"?

I started using ZeroMQ this week, and when using the Request-Response pattern I am not sure how to have a worker safely "hang up" and close his socket without possibly dropping a message and causing the customer who sent that message to never get a…
Brandon Rhodes
  • 83,755
  • 16
  • 106
  • 147
20
votes
2 answers

Redis Cluster vs ZeroMQ in Pub/Sub, for horizontally scaled distributed systems

If I were to design a huge distributed system whose throughput should scale linearly with the number of subscribers and number of channels in the system, which would be better ? 1) Redis Cluster (only for Redis 3.0 alpha, if its in cluster mode, you…
João Pinto Jerónimo
  • 9,586
  • 15
  • 62
  • 86
20
votes
5 answers

Compiling JZMQ on Ubuntu

Hello all I'm attempting to follow the directions located at: https://github.com/nathanmarz/storm/wiki/Installing-native-dependencies for installing Zero MQ as a dependency for Storm on a Ubuntu 12.04 machine. However when trying to run the make…
Chris Maness
  • 1,682
  • 3
  • 22
  • 40
19
votes
4 answers

Why do operating systems limit file descriptors?

I ask this question after trying my best to research the best way to implement a message queue server. Why do operating systems put limits on the number of open file descriptors a process and the global system can have? My current server…
jdi
  • 90,542
  • 19
  • 167
  • 203
19
votes
1 answer

Symfony2 WebSocketBundle - ZMQ Push not working

I'm using Symfony2 to build a simple chat application. I decided to use the GeniusesOfSymfony/WebSocketBundle for my WebSocket, which is powered by Ratchet : https://github.com/GeniusesOfSymfony/WebSocketBundle I managed to get the chat working…
Royar
  • 611
  • 6
  • 21
19
votes
3 answers

Do you know any projects where ZeroMQ was used? Both success and failure stories are valuable

I'm interested in using ZeroMQ in a project, but I'd like to hear about other's experience with it. I did some searching but found only mongrel2 project. Have you heard about other projects where it is used? What companies use ZeroMQ in production?
gleber
  • 4,392
  • 1
  • 26
  • 28
18
votes
4 answers

How to use Zeromq's inproc and ipc transports?

Im a newbie to ZERMQ. ZeroMQ has TCP, INPROC and IPC transports. I'm looking for examples using python and inproc in Winx64 and python 2.7, which could also be used for linux. Also, I have been looking for UDP methods of transport and cant find…
Merlin
  • 24,552
  • 41
  • 131
  • 206