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
10
votes
3 answers

How Scalable is ZeroMQ?

How scalable is ZeroMQ? I'm especially interested in understanding its potential for running on a large number (10,000 - 15,000) of cores.
Mark Harrison
  • 297,451
  • 125
  • 333
  • 465
10
votes
3 answers

Python zeromq -- Multiple Publishers To a Single Subscriber?

I'd like to write a python script (call it parent) that does the following: (1) defines a multi-dimensional numpy array (2) forks 10 different python scripts (call them children). Each of them must be able to read the contents of the numpy array…
user3262424
  • 7,223
  • 16
  • 54
  • 84
10
votes
4 answers

Using ZeroMQ for cross platform development?

We have a large console application in Haskell that I have been charged with making cross platform and adding a gui. The requirements are: Native-as-possible look and feel. Clients for Windows and Mac OS X, Linux if possible. No separate runtime to…
clintm
  • 1,259
  • 10
  • 23
10
votes
1 answer

java.lang.ArrayIndexOutOfBoundsException: 256 with jeromq 0.3.6 version

I am using Jeromq in multithreaded environment as shown below. Below is my code in which constructor of SocketManager connects to all the available sockets first and I put them in liveSocketsByDatacenter map in the connectToZMQSockets method. After…
john
  • 11,311
  • 40
  • 131
  • 251
10
votes
2 answers

Using ZeroMQ with C# with inproc transport

I'm experimenting with ZeroMQ and trying to get something working. My first thought was to set up a REP/REQ using the inproc transport to see if I could send messages between two threads. Most of the below code is taken from the clzmq examples,…
jonnii
  • 28,019
  • 8
  • 80
  • 108
10
votes
2 answers

zeromq - advantages of the router dealer pattern

Could anyone please provide a real-world example of using zmq with the router/dealer pattern, and explain its advantage over the more simple publish/subscribe pattern? Thanks.
Mister_L
  • 2,469
  • 6
  • 30
  • 64
10
votes
2 answers

Understanding Celluloid Concurrency

Following are my Celluloid codes. client1.rb One of the 2 clients. (I named it as client 1) client2.rb 2nd of the 2 clients. (named as client 2 ) Note: the only the difference between the above 2 clients is the text that is passed to the server.…
Viren
  • 5,812
  • 6
  • 45
  • 98
10
votes
1 answer

Why does TCP/IP on Windows7 take 500 sends to warm-up? ( w10,w8 proved not to suffer )

We are seeing a bizarre and unexplained phenomenon with ZeroMQ on Windows 7, sending messages over TCP.( Or over inproc, as ZeroMQ uses TCP internally for signalling, on Windows ). The phenomenon is that the first 500 messages arrive slower and…
Pieter Hintjens
  • 6,599
  • 1
  • 24
  • 29
10
votes
1 answer

How to add topic filters when calling recv_pyobj() in ZeroMQ?

ZeroMQ provides pretty good documentation about how to set up a pub-sub pattern with the topic filter, as described in the api docs. ZeroMQ also provides the methods socket.send_json() and socket.send_pyobj() (and the recv counterparts) for…
Wapiti
  • 1,851
  • 2
  • 20
  • 40
10
votes
2 answers

zmq-cpp: recv() waits for data despite ZMQ_DONTWAIT being set

I'm trying to implement a non-blocking receive method with ZeroMQ using the ZMQ_DONTWAIT flag but recv() behaves like being called without the flag: auto start = std::chrono::steady_clock::now(); auto have_data = sock_->recv(&reply,…
frans
  • 8,868
  • 11
  • 58
  • 132
10
votes
3 answers

zeromq and python multiprocessing, too many open files

I have an agent-based model, where several agents are started by a central process and communicate via another central process. Every agent and the communication process communicate via zmq. However, when I start more than 100 agents standard_out…
Davoud Taghawi-Nejad
  • 16,142
  • 12
  • 62
  • 82
10
votes
1 answer

Build zeromq for iOS with libsodium, randombytes error

I'm building zeromq library for iOS using this method: https://github.com/drewcrawford/libzmq-ios The build log looks fine except of some warnings that appear 3 times: CC…
Wez Sie Tato
  • 1,186
  • 12
  • 33
10
votes
1 answer

Sharing data using pyzmq zero-copy

I stumbled on zeromq when searching for an efficient solution to IPC in python; I have a couple of python processes which need to do some cpu intensive processing on data from a dict in a master process. These worker processes only read from the…
Martijnh
  • 333
  • 2
  • 10
10
votes
2 answers

Compiling C code using zmq API

I am failed to compile builtin example hwserver.c using ZeroMQ APIs. I have tried every possible way. gcc -lzmq hwserver.c -o hwserver It prompts me with: hwclient.c:(.text+0x22): undefined reference to `zmq_ctx_new' hwclient.c:(.text+0x3a):…
Sam
  • 423
  • 2
  • 9
  • 23
10
votes
2 answers

How to check if JZMQ socket is connected

Is there way to check if JZMQ (java binding of zmq) socket is connected? ZContext zmqContext = new ZContext(); ZMQ.Socket workerSocket =…
Michal Zmuda
  • 5,381
  • 3
  • 43
  • 39