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
2 answers

0MQ with green threads?

I've grown to like erlang, and it's a great (cough) architectural fit to my problem. Meanwhile I still like to imagine that I can kludge erlang processes & asynchronous message passing in python (I am currently in therapy to rid myself of this…
user402476
  • 367
  • 1
  • 2
  • 9
7
votes
1 answer

pyzmq recv_json can't decode message sent by send_json

Here is my code with the extraneous stuff stripped out: coordinator.py context = zmq.Context() socket = context.socket(zmq.ROUTER) port = socket.bind_to_random_port(ZMQ_ADDRESS) poller = zmq.Poller() poller.register(socket, zmq.POLLIN) while…
Anentropic
  • 32,188
  • 12
  • 99
  • 147
7
votes
1 answer

AttributeError: 'str' object has no attribute 'decode'

I am going to install ZeroMQ library in my pc using pip package installer. I use https://learning-0mq-with-pyzmq.readthedocs.org/en/latest/pyzmq/basics.html#installation as my reference. After executing follwing command: pip install pyzmq-static I…
Seyed Morteza Mousavi
  • 6,855
  • 8
  • 43
  • 69
7
votes
1 answer

ZMQ: No subscription message on XPUB socket for multiple subscribers (Last Value Caching pattern)

I implemented the Last Value Caching (LVC) example of ZMQ (http://zguide.zeromq.org/php:chapter5#Last-Value-Caching), but can't get a 2nd subscriber to register at the backend. The first time a subscriber comes on board, the event[0] == b'\x01'…
orange
  • 7,755
  • 14
  • 75
  • 139
7
votes
1 answer

How to use ProtoBuf extensions to get polymorphism in C++

I am trying to define a common basic message which defines the type of the message (for easier parsing) and is then extended with the actual message. The messages will be used in an RPC way. My .proto file syntax = "proto2"; package userapi; //…
x29a
  • 1,761
  • 1
  • 24
  • 43
7
votes
2 answers

How do I bundle zeromq with an electron app?

Introducing zmq into my Electron app has proved to be onerous: 01:33:03 {master %=} rgbkrk@puter ~/code/jupyter-sidecar$ electron . dyld: lazy symbol binding failed: Symbol not found:…
Kyle Kelley
  • 13,804
  • 8
  • 49
  • 78
7
votes
1 answer

Zeromq which socket should bind on PubSub pattern

I have been reading about ZeroMQ more specifically about NetMQ and almost every Pub/Sub examples I saw used to Bind the Publisher socket and then the Subscriber socket connects to the other. So i'm wondering if it is possible to do the reverse, i…
mmarques
  • 625
  • 3
  • 9
  • 27
7
votes
2 answers

Reason for zmq error code 156384763

I am using zmq req/rep pattern communication. The implementation is pretty simple, the req sends some data and waits on recv. The rep receives the data, process and reply back. //REQ zmq_connect zmq_send zmq_recv…
Kumar
  • 616
  • 1
  • 18
  • 39
7
votes
1 answer

ZeroMQ PUB/XPUB/XSUB/SUB filtering

I am trying to determine the exact behaviour and potential limitations of the so-called 'Extended Pub-Sub architecture' from the ØMQ guide. XPUB and XSUB are described: We need XPUB and XSUB sockets because ZeroMQ does subscription forwarding from…
Drew Noakes
  • 300,895
  • 165
  • 679
  • 742
7
votes
3 answers

ZeroMQ doesn't auto-reconnect

I've just downloaded and installed zeromq-4.0.5 on an Unbutu Precise (12.04) system. I've compiled the hello-world client (REQ, connect, 127.0.0.1) and server (REP, bind) written in C. I start the server. I start the client. Each second the client…
pts
  • 80,836
  • 20
  • 110
  • 183
7
votes
3 answers

ZMQ socket gracefully termination in Python

I have the following ZMQ script #!/usr/bin/env python2.6 import signal import sys import zmq context = zmq.Context() socket = context.socket(zmq.SUB) def signal_term_handler(signal, fname): socket.close() sys.exit(0) def main(): …
boaz_shuster
  • 2,825
  • 20
  • 26
7
votes
2 answers

Is ZMQ TCP socket different from conventional TCP?

I am new to ZMQ. I find ZMQ socket implementation much simpler than winsock. But my doubt is that "can a client created using ZMQ TCP socket talk to conventional TCP server?" in other words Can my ZMQ client communicate with a TELNET server…
Kumar
  • 616
  • 1
  • 18
  • 39
7
votes
2 answers

ZeroMQ / 0mq or nanomsg bindings to Kafka?

In Fred Georges talk about microservice architectures, he mentions using Kafka as a high speed bus (he refers to as the rapids) and connecting multiple 0mq instances (referred to as rivers) to it. A slide of this can be seen here. Can anyone share…
user1074891
  • 279
  • 3
  • 14
7
votes
0 answers

ZeroMQ doesn't spot libsodium

I'm hoping to get the CurveCP functionality working within ZeroMQ ØMQ. I'm using CentOS as the underlying OS. After downloading and running ZeroMQ, I've done the usual ./configure, make and sudo make install. Then running make check returned…
Chrisky
  • 567
  • 3
  • 9
7
votes
3 answers

What is the proper way to wait for connections?

I am trying to implement a simple message passing between two applications using NetMQ (a slightly more elaborate description of what I am trying to achieve is below). After a bit of trial and error I've found that I can't just send or receive…
orom
  • 851
  • 1
  • 10
  • 22