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

lost messages on zeromq pub sub

I'm trying to implement the pub sub design pattern using zeromq framework. The idea is to launch a subscriber and afterwards to launch the publisher. The subscriber will listen to 100 messages and the publisher will publish 100 messages. So far so…
omer bach
  • 2,345
  • 5
  • 30
  • 46
18
votes
5 answers

Reserve a TCP port in Windows

I'd like to reserve a TCP port, to be bound by a service later, so that Windows doesn't inadvertently use the same number when assigning random port numbers. I know this is possible via the registry and a reboot, but I would like to avoid such a…
Marcelo Cantos
  • 181,030
  • 38
  • 327
  • 365
18
votes
3 answers

How to import zeromq libraries in cmake?

I'm just starting to learn how to work with zeromq libraries and using them in different C++ projects. The sample code that I wrote (actually copied from there tutorials)is this: // file: main.cpp // Hello World client in C++ // Connects REQ…
Omid N
  • 947
  • 2
  • 11
  • 24
18
votes
2 answers

ZeroMQ PUB/SUB Pattern with Multi-Threaded Poller Cancellation

I have two applications, a C++ server, and a C# WPF UI. The C++ code takes requests (from anywhere/anyone) via a ZeroMQ messaging [PUB/SUB] service. I use my C# code for back testing and to create "back tests" and execute them. These back tests can…
MoonKnight
  • 23,214
  • 40
  • 145
  • 277
18
votes
2 answers

Ratchet PHP WAMP - React / ZeroMQ - Specific user broadcast

Note: This is not the same as this question which utilises MessageComponentInterface. I am using WampServerInterface instead, so this question pertains to that part specifically. I need an answer with code examples and an explanation, as I can see…
Jimbo
  • 25,790
  • 15
  • 86
  • 131
18
votes
2 answers

zeromq, C++, is it necessary to set a high water mark for subscribers?

I did a quick test of the ZeroMQ PUB/SUB and now have some working code. However, I am a bit confused about the concept of high water mark as applied in zeromq. I have set a HWM in my publisher code which sets a queue length for each subscriber…
user788171
  • 16,753
  • 40
  • 98
  • 125
18
votes
1 answer

zmq - when to use zmq_bind or zmq_connect

Refer to http://hintjens.wdfiles.com/local--files/main:files/cc1pe.pdf Page 22 Chapter Divide and Conquer Ventilator[PUSH] ___________________|____________________ | | …
q0987
  • 34,938
  • 69
  • 242
  • 387
17
votes
2 answers

Node.js socket.send( ) functions failing to complete before exit

In some Node.js scripts that I have written, I notice that even if the last line is a synchronous call, sometimes it doesn't complete before Node.js exits. I have never seen a console.log statement fail to run/complete before exiting, but I have…
Alexander Mills
  • 90,741
  • 139
  • 482
  • 817
17
votes
3 answers

Does zeromq support IPC as a transport channel on windows?

I get the following error message, when I try the router example wiht python on Windows (Windows 8): Traceback (most recent call last): File "router.py", line 43, in client.bind("ipc://routing.ipc") File "socket.pyx", line 432, in…
Klaus Rohe
  • 782
  • 2
  • 7
  • 11
17
votes
2 answers

Is jeromq production ready?

I've used ZeroMQ in the past with with JVM applications via the jzmq library. I am planning on using zeromq on a new project where some of the services are implemented on the JVM. I just discovered jeromq, a pure java implementation of zeromq, and…
Ben Mabey
  • 1,269
  • 10
  • 18
17
votes
3 answers

Zeromq: How to access tcp message in c++

I am a new-by to ZeroMQ and make my way through the C++ hello-world example of the echo client-server pattern (Request-Reply). The server looks like: // // Hello World server in C++ // Binds REP socket to tcp://*:5555 // Expects "Hello" from client,…
dhpizza
  • 361
  • 1
  • 2
  • 10
17
votes
1 answer

What is the rationale behind zeroMQ context?

While poking around zeroMQ (A very useful socket replacement for those who don't know), I came across this question in the mailing list: Using multiple contexts : Is there a downside to using multiple contexts? Is there a downside to using…
PicoCreator
  • 9,886
  • 7
  • 43
  • 64
16
votes
7 answers

lists or dicts over zeromq in python

What is the correct/best way to send objects like lists or dicts over zeromq in python? What if we use a PUB/SUB pattern, where the first part of the string would be used as a filter? I am aware that there are multipart messages, but they where…
Davoud Taghawi-Nejad
  • 16,142
  • 12
  • 62
  • 82
16
votes
1 answer

Am I using reactive-banana right?

Here's an example Haskell FRP program using the reactive-banana library. I'm only just starting to feel my way with Haskell, and especially haven't quite got my head around what FRP means. I'd really appreciate some critique of the code below {-#…
Ben Ford
  • 2,087
  • 21
  • 26
16
votes
2 answers

node-gyp 'pkg-config: command not found' on mac 10.5.8 during npm install

Trying to do an npm install on mac-osx of github project. Don't see pkg-config in packages.json why would node-gyp expect this? It seems like the node-gyp should have incldued pkg-config. I thought this is the way node works. Install a package and…
Mobile Man
  • 291
  • 2
  • 5
  • 13