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

How to detect whether linger was reached when closing socket using ZeroMQ?

The following dispatch() function runs receives messages through a Queue.queue and sends them using a ZeroMQ PUSH socket to an endpoint. I want this function to exit, once it receives None through the queue, but if the socket's underlying message…
Shuzheng
  • 11,288
  • 20
  • 88
  • 186
1
vote
2 answers

How to exit endless zmq_poll when host ip address changes?

I wrote a zmq proxy with zmq_poll() with 3 frontends and 3 backends and timeout of -1 which makes it endless. Frontend sockets use the connection-oriented tcp://-transport-class and are zmq_bind() associated with the tcp-ports on the host IP-address…
H00man
  • 375
  • 1
  • 7
  • 21
1
vote
1 answer

In ZeroMQ how can a client detect that an authentication attempt has failed?

ZeroMQ seems to provide some authentication mechanisms. That's a great thing but the connection seems to be performed in the background and authentication might fail if something hasn't been configured correctly. Therefore my question is: How can a…
Regis May
  • 3,070
  • 2
  • 30
  • 51
1
vote
1 answer

Use ZeroMQ for forwarding packets in an interface

Is it possible to use ZeroMQ as an intermediate point where different programs can send packets to an ip:port combination or alternatively network interface and have ZeroMQ forward any such packets in a specific outbound connection? So basically I…
dearn44
  • 3,198
  • 4
  • 30
  • 63
1
vote
1 answer

How to change the value of a variable at run time from another script at remote machine?

I have a local computer A and remote computer B. Computer A has script client.py Computer B has server.py Script client.py has a variable port. Let's say port = 5535. I am running client.py on Computer A, which is using the port number for socket…
1
vote
1 answer

Issue in sending data to the server pyzmq

I have the following code sending array from the server to the client using req and reply pattern, def send_array( socket, A, flags = 0, copy = True, track = False ): """send a numpy array with metadata""" md = dict( dtype = str( A.dtype ), …
gohar shah
  • 165
  • 1
  • 10
1
vote
1 answer

Interprocess communication on AWS Batch

Is it possible to use ZeroMQ for interprocess communication between a job on AWS Batch and a local parent process? If so, is there a simple example I can refer to? I am having trouble finding documentation on this. I am asking with hopes that the…
landau
  • 5,636
  • 1
  • 22
  • 50
1
vote
1 answer

How to avoid many connected DEALER-s to crash a ZeroMQ ROUTER?

I have a ROUTER-socket in an application that multiple DEALER-sockets, in different applications, connect to. I'd like the ROUTER to be as robust as possible. Here is a specific scenario I'd like to handle well on the ROUTER : 1000-s of DEALER-s…
TheGaldozer
  • 95
  • 1
  • 9
1
vote
1 answer

How to send a file by a zmq multipart message?

I'm trying to send a video using a ZeroMQ infrastructure and I split the video into chunks to send it. When I do it and put the video into a vector to send it through zmq::send_multipart I get a very high usage of RAM memory and so times later I get…
Eduardo Mosca
  • 71
  • 1
  • 7
1
vote
1 answer

Unable to connect to open another tcp connection in an existing tcp connection in openzmq

I am connecting to client-2 from client-1 and client-2 to server. I am sending frames from the client-1 to client-2 and on client-2, I am performing prediction and sending the result to the server.I have the following code. Client-1 code: context…
Mazia
  • 63
  • 1
  • 10
1
vote
1 answer

How to separate message zmq server?

I am trying to send a video through a ZeroMQ server and I successfully got it with a 1 GB video, but when I try to send a movie with, with a very larger size ( 6.7 GB ) I get the following error: cliente: /usr/local/include/zmq.hpp:1958:…
Eduardo Mosca
  • 71
  • 1
  • 7
1
vote
1 answer

Why is ZeroMQ poller not receiving messages (python)?

I'm trying to use the ZeroMQ Poller() functionality with two sockets in python: import zmq # Prepare our context and sockets context = zmq.Context() receiver =…
hao123
  • 381
  • 2
  • 6
  • 21
1
vote
1 answer

How to transfer live data between Python and MQL4?

Python code: import zmq import sys port ="5555" print("Connecting to hello world server…") context = zmq.Context() socket = context.socket(zmq.REQ) # Socket to talk to server socket.connect("tcp://localhost:%s"%port) while(1): …
1
vote
2 answers

What is the most efficient ZeroMQ polling on a single PUB/SUB socket?

The ZeroMQ documentation mentions a zmq_poll as a method for multi-plexing multiple sockets on a single thread. Is there any benefit to polling in a thread that simply consumes data from one socket? Or should I just use zmq_recv? For example: /* …
1
vote
1 answer

How to receive a multipart message in ZMQ using Java?

As simple as this operation seems I can't find any documentation regarding how to receive a multipart message using ZMQ (Jeromq). I checked The Guide but it only contains C code with this info and it seems that I'm supposed to receive messages the…
Adam Arold
  • 29,285
  • 22
  • 112
  • 207