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
7
votes
4 answers

ZeroC ICE vs 0MQ/ZeroMQ vs Crossroads IO vs Open Source DDS

How does ZeroC ICE compare to 0MQ? I know that 0MQ/Crossroads and DDS are very similar, but cant seem to figure out where ICE comes in. I need to quickly implement a system that offloads real-time market-data from C++ to C#, as a first phase of my…
jaybny
  • 1,026
  • 2
  • 13
  • 29
7
votes
3 answers

ZeroMQ: how to achieve C-like multithreading

In C we have Sockets and descriptors, it is possible to just take one of these and hand them over to a Thread, this makes it possible that you can accept incoming connections and give the work to a Thread you like and the Thread can send by itself…
Oliver
  • 928
  • 9
  • 25
7
votes
1 answer

How to build a project (say zeromq) as static library and linked it into my project

I want to use the zeroMQ in my project and I run the configure as below to build the libaray into my home folder ./configure --enable-static --disable-shared --prefix=/home/xx/out then I link my project by gcc -o myproject x.c y.c…
sureone
  • 831
  • 2
  • 14
  • 25
6
votes
1 answer

Why does this Python 0MQ script for distributed computing hang at a fixed input size?

I recently started learning 0MQ. Earlier today, I ran into a blog, Python Multiprocessing with ZeroMQ. It talked about the ventilator pattern in the 0MQ Guide that I read about, so I decided to give it a try. Instead of just calculating products of…
6
votes
1 answer

ZMQ Pub-Sub Program Failure When Losing Network Connectivity

I have a simple pub-sub setup on a mid-sized network, using ZMQ 2.1. Although some subscribers are using C# bindings, others are using Python bindings, and the issue I'm having is the same for either. If I pull the network cable from a machine…
jomido
  • 1,188
  • 1
  • 12
  • 17
6
votes
2 answers

Cross-compiling ZeroMQ to ARM for use in a MonoTouch iPhone app configure settings

I'm attempting to use the ZeroMQ library in an iPhone app developed in C# using MonoTouch. I've solved almost all of the problems, but have fallen at the last hurdle. I'm using ZeroMQ 2.1.10, and the C# CLR binding/wrapper, and developing in Mac OS…
yorkshirespud
  • 727
  • 6
  • 14
6
votes
1 answer

Is it helpful to use ZeroMQ to build a peer-to-peer workload scheduler?

I am coding a workload scheduler. I would like my piece of software to be a peer-to-peer scheduler, ie. a node only knows some neighbours (other nodes) and use them to reach other nodes. Each node would have its own weighted-routing table to send…
Mathieu G.
  • 113
  • 8
6
votes
1 answer

ZeroMQ IPC across several instances of a program

I am having some problems with inter process communication in ZMQ between several instances of a program I am using Linux OS I am using zeromq/cppzmq, header-only C++ binding for libzmq If I run two instances of this application (say on a…
Alain Daccache
  • 125
  • 1
  • 12
6
votes
4 answers

ZeroMQ: Check if someone is listening behind Unix domain socket

Context: Linux (Ubuntu), C, ZeroMQ I have a server which listens on ipc:// SUB ZeroMQ socket (which physically is a Unix domain socket). I have a client which should connect to the socket, publish its message and disconnect. The problem: If server…
Alexander Gladysh
  • 39,865
  • 32
  • 103
  • 160
6
votes
3 answers

Problems with Inverted PUB/SUB with ZeroMQ

I'm trying to set up "inverted" PUB/SUB with ZeroMQ. Meaning that subscribing (SUB) sockets belong to several long-living servers, doing zmq_bind(); and publishing (PUB) socket is a short-lived client and does zmq_connect(). I use a single ipc://…
Alexander Gladysh
  • 39,865
  • 32
  • 103
  • 160
6
votes
2 answers

Python ZMQ responder not receiving message

I am trying a simple zmq script but somehow the responder is not getting the first message. The Responder looks like this: def main(): context = zmq.Context() socket = context.socket(zmq.REP) …
GöCo
  • 85
  • 6
6
votes
1 answer

Create a group of streamers and publishers

I have a number of nodes that will use a secondary service to be informed about the address of each other. I want to be able to publish information so as all the other nodes can hear it. Using an XPUB socket is not an option I would want to go with…
dearn44
  • 3,198
  • 4
  • 30
  • 63
6
votes
1 answer

How to send both image(ndarray) and string data in single ZMQ send request

For sending string data, following codes works : context = zmq.Context() socket = context.socket(zmq.PUB) socket.bind("tcp://*:5667") socket.send_string("my string data") For sending image(ndarray) following code works : def send_array(socket,…
Rohit Lal
  • 2,791
  • 1
  • 20
  • 36
6
votes
2 answers

Build zeromq on Windows 10 with CMake

In the past I’ve used the Visual Studio solution files to build zeromq (libzmq) on Windows. I just noticed that the Visual Studio solutions have been deprecated because they are too difficult to maintain. The alternative is to use CMake; trouble…
GoFaster
  • 835
  • 1
  • 12
  • 23
6
votes
1 answer

ZeroMQ PUSH/PULL and lost message

I'm making use of ZeroMQ from .NET and got stuck trying to fix a weird issue. I've got a socket of type PUSH and one of type PULL over TCP. When the client disconnects, the server is still able to to send a message (note that no flags are passed to…
em70
  • 6,088
  • 6
  • 48
  • 80