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

QNX's shutdown_system is not function well when ZMQ lib is used

When QNX's shutdown_system() is called from command line (shutdown) or from within any process, it's expected to restart the system,when called as shutdown_system(SHUTDOWN_REBOOT, 0); There are several processes running on our QNX system. For…
user6868820
  • 75
  • 1
  • 1
  • 7
1
vote
1 answer

Which pattern should be used when implementing a multi-process program with ZeroMQ?

We are working on a multi-process program like chrome ipc. The communication between parent and child process will utilize ZeroMQ. The parent will send specific messages to specific child. And the child will also transmit messages to parent at a…
heLomaN
  • 1,634
  • 2
  • 22
  • 33
1
vote
1 answer

GNU Radio OOT block : AttributeError: 'module' object has no attribute 'pthread' (using ZeroMQ sockets)

I've developed an Out of tree block in GNU Radio with C++. I'm using the ZMQ sockets,which are implemented with the library, to pass data through two threads. When I try to execute my OOT block (pthread block) in GNU Radio companion, what…
1
vote
0 answers

ZeroMQ architecture for cache-like service

I made a service which accepts requests on a 0MQ router socket in NetMQ, and acts mostly like a cache for other apps, i.e. it can receive a "GET" request and send a response, or it can receive a "PUT" request which doesn't need a response. I have…
Lou
  • 4,244
  • 3
  • 33
  • 72
1
vote
1 answer

Can ZMQ context switch during an event?

I am trying to create a Python producer and consumer using 2 asynchronous functions. 1 of the functions is a callback getting data from server (producer), the other is a timed callback that executes every N seconds (consumer). I am trying to use…
Steve Freed
  • 91
  • 1
  • 11
1
vote
2 answers

Why ZeroMQ SUBs are missing messages?

I built about 12000 subscribers per computer with threading as following subscriber side: def client(id): context=zmq.Context() subscriber=context.socket(zmq.SUB) subscriber.connect('ip:port') …
Ian
  • 17
  • 4
1
vote
0 answers

Create function not defined in ZMQ header file - MQL4

I got issue about header file in MetaTrader 4. I'm using ZMQ libraries and header files. It worked good,but without changing anything something went wrong, exactly: "create function not defined". This error occured in Mql/Lang/GlobalVariables.mqh…
1
vote
1 answer

What would be the right ZMQ Pattern?

I am trying to build a ZeroMQ pattern where, There can be many clients connecting to a single server endpoint Server will distribute incoming client tasks to available workers (will be mapped to the number of cores on the server) These tasks are…
Yogi
  • 11
  • 1
1
vote
1 answer

Using ZMQ_XPUB_MANUAL with zeromq.js

I am trying to implement a pub/sub broker with ZeroMQ where it is possible to restrict clients from subscribing to prefixes they are not allowed to subscribe to. I found a tutorial that tries to achieve a similar thing using the ZMQ_XPUB_MANUAL…
D. Kaiser
  • 159
  • 1
  • 9
1
vote
1 answer

ZeroMQ bind API zmq_bind() to 127.0.0.1:5555 returns error 19

I am learning ZeroMQ for which I tried to bind it to local host as follows: void* m_zmqContext; void* m_zmqSocket; m_zmqContext = zmq_ctx_new(); unsigned int error_code = zmq_errno(); printf("server ctx error: %u, %s\n", error_code,…
RKum
  • 758
  • 2
  • 12
  • 33
1
vote
0 answers

Does this function need to be async?

I have some async websocket code that runs forever and gives me data on a zmq socket. On my "receiver" page, I have this code: while True: msg = zmqsocket.signal_recv() new_msg = data_preparation_function(msg) other_function(new_msg) My…
Rbdm
  • 39
  • 4
1
vote
0 answers

NetMQ: Can NetMQPoller take care of async message sending?

Does anyone have an example of using a NetMQPoller in conjunction with sending messages from an asynchronous task? i.e. // 1. Receive a message from one of many clients // 2. Handle client requests on multiple async Task's (may be file bound) // 3.…
millejos
  • 301
  • 3
  • 14
1
vote
1 answer

How to display an output from ZMQ to a Qt GUI in run time?

I am trying to take the output of the client of 'ZeroMQ' and display it through Qt designer python script. The code already receives data correctly but I can't display it on the GUI window and receiving it. It only displays the first line. I am…
Shams
  • 13
  • 4
1
vote
2 answers

Mulitprocess management in Python with aiomultiprocess

I have a problem with the multiprocessing in Python. I need to create async processes, which run a undefined time and the number of processes is also undefined. As soon as a new request arrives, a new process must be created with the specifications…
1
vote
1 answer

Detecting a "join" ZMQ

I'll keep it short. Using ZMQ to communicate between Python(server) and C ( client ). ( made a game ) The goal is to get the server side running only when the client connects. Is there a way to detect something in ZeroMQ to start the program?
MikCil98
  • 21
  • 5