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
1
vote
1 answer

ZeroMQ pattern for request/response via intermediate server

We're working on a project which requires the following: One web server to create user interface for end user; Many Raspberry devices, all have internet access; One intermediate server for an always-on service, which keep connections with RPi…
Kenna
  • 15
  • 3
1
vote
1 answer

GNU Radio ZMQ Blocks REP - REQ

I am trying to connect GNU Radio to a python script using the GR ZMQ REP / REQ blocks. GR is running on a Raspberry Pi 4 on router address 192.168.1.25. The python script is on a separate computer, from which I can successfully ping 192.168.1.25. …
Andy
  • 131
  • 8
1
vote
1 answer

How to create a server in Mathematica container?

I try to create a server in a Docker container using Wolfram Language. Docker parameters and Wolfram script, which starts a server inside it, are in the attached files: docker-compose.yml services: wm: build: . volumes: -…
1
vote
1 answer

python zeromq Parallel Pipeline multiple consumers (workers)

Hello together! I would like to combine data from different python programs via zeromq. I think for that job the best solution would be parallel pipelines as are described in this example at the ponit "3. Parallel Pipeline (parallel pipeline…
Toffi
  • 11
  • 1
1
vote
1 answer

Migrate a "zmq_send" command to Python

I have a c function that publish data to a c++ subscriber, now I want to migrate this c function to Python: void setup_msg_publish() { int r; zmqcontext = zmq_ctx_new(); datasocket = zmq_socket(zmqcontext, ZMQ_PUB); r =…
axel_ande
  • 359
  • 1
  • 4
  • 20
1
vote
1 answer

CMake find_package for another library in same project

I want to make a builder project that checks out sub-modules and builds them as a group, and I would like to build them in a single pass. builder submod1 submod2 #depends on submod1 submod3 #depends on submod2 For testing I downloaded…
Sir Demios
  • 83
  • 11
1
vote
1 answer

Using NetMQMonitor to detect server disconnects?

I am looking for a better way to detect disconnects when a Router/server goes down or is unavailable due to a poor connection. (I'm Listening from a Dealer/client running on wifi) I found zmq_socket_monitor() and discovered that NetMQ has the same…
millejos
  • 301
  • 3
  • 14
1
vote
1 answer

How to listen close event using ZeroMQ?

A client script : var ZMQ = require('zeromq') , sock = ZMQ.socket('pull'); socket.on('close',function()) { // print socket closed process.exit(1) } I can't find any proper document for listen a close event. I want to listen close event so…
unknown_user
  • 130
  • 1
  • 10
1
vote
1 answer

ZeroMQ - subscriber is able to receive data from 1st publisher but does not receive from 2nd publisher which is up after a few loops

In following code. Publisher thread publish 5 messages then again new publisher socket is supposed to send data to subscriber but subscriber is in while(1) loop for recv() and never get message from 2nd publisher. How subscriber can connect to…
munish
  • 11
  • 1
1
vote
1 answer

ZMQ : Receive from different computers

I have different computers publishing to master computer. And I have list of their IP addresses. The code below works fine when there is only one IP in the list, but when there is more than one IP it doesn't work. when trying "Try, except" It seems…
Ahmed
  • 89
  • 7
1
vote
0 answers

How to tell which functions and constants are exposed in the MATLAB interface of jeromq

I am using jeromq (jeromq-0.5.2.jar) inside MATLAB (R2018a). I can open sockets and send and receive data. I want to make my code as robust as possible, so am using Req/Rep sockets, and want to set various socket options, and use non blocking recv…
Paulus
  • 1,385
  • 16
  • 20
1
vote
0 answers

Using ZMQ on iOS

I am trying to build an iOS app that is exposed to a fairly extensive Rust project, but I am having issues with one of the dependencies in the project. The Rust project has a ZMQ dependency, and while I am able to build the project on my Mac, when…
1
vote
1 answer

Apache server running on PHP ver. 8.0.1 won't load React/ZMQ extension on startup

I am trying to experiment web sockets with cakephp ver 4. My server is WAMP 3.2.6 x64 running on Win 10 and PHP 8.1.0 set as preferred engine version. It turns out that zmq-extension has to be enabled in php.ini file. And there lies my problem: I've…
1
vote
1 answer

How to include external library to omnetpp Makefile

I am new to omnetpp. In my source file, I include zmq.h header and I can successfully make Makefile with opp_makemake --make-so -f --deep Next, running make does not give any errors either Creating shared library: out/gcc-release//libtictoc_r.so So…
Python
  • 359
  • 2
  • 16
1
vote
1 answer

Imagezmq filter received data on text message in REQ_REP pattern

I want to filter out image data as per the text message attached to it. Hub Code import imagezmq import cv2 hub = imagezmq.ImageHub() print('Listening') while True: rpi_name, image = hub.recv_jpg() print('Received from ' + rpi_name) …