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

zeromq plain authentication -> example with C++ library?

I cannot get the plain authentication to work with the core zeromq C++ library. I can get it to work with pyzmq with no issues. I noticed that the C and Python zeromq APIs have an authenticator that is run as a separate thread, but I don't see a…
hokiegeek2
  • 303
  • 3
  • 7
1
vote
0 answers

How to correctly receive data using ZeroMQ?

I have two machines in the same network : The first machine binds to a socket on its own IP address (120.0.0.1) and receives any data coming to the socket .bind()-ed on port 5555: zmq::context_t context{1}; zmq::socket_t socket{context,…
aikhs
  • 949
  • 2
  • 8
  • 20
1
vote
1 answer

How do I implement multiple sockets with ZeroMQ?

I have this implementation to create a socket : if (gctx == nullptr) { gctx = zmq_ctx_new(); gsock = zmq_socket(gctx, ZMQ_REQ); } snprintf(url, sizeof(url), "wsd:///tmp/hfg/%s", name); int rc = zmq_connect(gsock,…
user13308941
1
vote
0 answers

How to build cppzmq on Windows?

I am trying to build cppzmq on Windows 10. I have cloned the repo from: https://github.com/zeromq/cppzmq I generate the cmake files with the following command: cmake -H. -BBuild -DCMAKE_PREFIX_PATH=../libzmq/build/ -DCMAKE_CXX_FLAGS=//w…
user3502541
  • 123
  • 1
  • 1
  • 8
1
vote
1 answer

Alternatives for interaction between C# and Python application -- Pythonnet vs DLL vs shared memory vs messaging

We have a big C# application, would like to include an application written in python and cython inside the C# Operating system: Win 10 Python: 2.7 .NET: 4.5+ I am looking at various options for implementation here. (1) pythonnet - embed the python…
mcsy
  • 43
  • 6
1
vote
1 answer

zeromq: ZMQ_CONFLATE==1 does not stop queues from saving old messages

With ZeroMQ and CPPZMQ 4.3.2, I want to drop old messages for all my sockets including PAIR Pub/Sub REQ/REP So I use m_socks[channel].setsockopt(ZMQ_CONFLATE, 1) on all my sockets before binding/connecting. Test However, when I made the following…
kakyo
  • 10,460
  • 14
  • 76
  • 140
1
vote
1 answer

How can I send PNG image over TCP sockets using ZeroMQ?

I have a Keras model working on Python and I want to send frames to this model from Unity 3D camera. I can easily transport strings among them by using an external library. This external library sends a byte array to Python. So, I converted Unity's…
Terminou
  • 49
  • 6
1
vote
1 answer

Why can't I compile the basic send and receive mock for zmq

I am writing a gmock for socket_t::send and socket_t::recv in zmq.hpp (zmq c++ header only binder) zmq_mock_class.h #pragma once namespace zmq { class ZmqMockSocketClass { public: virtual size_t send(const void *buf_, size_t len_, int flags_ = 0)…
preetam
  • 1,451
  • 1
  • 17
  • 43
1
vote
0 answers

How to repeat an example with Ratchet Push?

I would like to repeat the Ratchet Push example. Downloaded Composer. In the project folder via the console (CLI) I entered: php composer.phar require cboden/ratchet, after which the vendor folder and a pair of files from Composer appeared. I…
Space Around
  • 67
  • 10
1
vote
0 answers

ZeroMQ : a thread stops exactly after 2 hours in a while(1)-loop. Why & how to resolve this?

It does not crash so there is no core to analyse. It simply stops. I have experimented multiple times. It stops exactly after 2 hours. OS : qnx6.5.0 LIBs : ZeroMQ and Protobuf I just have a single thread, it looks something like this…
user6868820
  • 75
  • 1
  • 1
  • 7
1
vote
1 answer

ZMQ::send() throws an exception and kills the QNX-process. Why and how to recover from it?

ZMQ::send() throws an exception and kills the process. Why and how to recover from it. I use the ZeroMQ REQ/REP pattern on QNX-version 6.5.0. The anticipated catch{} block does not receive this exception. Here is the gdb trace : (gdb) bt #0 …
user6868820
  • 75
  • 1
  • 1
  • 7
1
vote
2 answers

ZeroMQ: How to publish to a number of receivers except for one of them

I have N subscribers to a Publisher. The message is a simple boolean value. The messaging pattern is slightly different from the regular PUB/SUB : When one subscriber receives a true, all the other subscribers are supposed to receive a false. So…
kakyo
  • 10,460
  • 14
  • 76
  • 140
1
vote
0 answers

What's the benefit of WebSockets + ZeroMQ vs just WebSockets?

Consider these two kinds of contexts / applications: 1) When you hit a button on a page containing several input fields (the page is not a HTML form), all the infos are retrieved and sent to the server. The server then performs several tasks with…
DevelJoe
  • 856
  • 1
  • 10
  • 24
1
vote
1 answer

Why does zmq pack several messages to one TCP frame?

I send messages using ZMQ_PUSH socket with ZMQ_DONTWAIT flag. Each message separated by 300ms (so I seriously doubt, that my thread scheduling is so off). However from time to time several (up to 7 so far) messages are packed to the same TCP frame…
jbulatek
  • 154
  • 10
1
vote
1 answer

ZeroMQ: how to use multiple Publishers and a single Client, using C < C11

I am new to ZeroMQ. I have multiple publishers and one client. Seeking suggestions to implement it in a best way. Currently its making use of a reply - request pattern for a single client and a server; this has to be extended to multiple publishers…
user6868820
  • 75
  • 1
  • 1
  • 7