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
9
votes
1 answer

ZMQ hanging - ZMQSocket::send

I've been testing out PHP websockets with Ratchet, and everything was working perfectly up until ZMQSocket::send suddenly started to hang for no apparent reason. $context = new ZMQContext(); $socket = $context->getSocket(ZMQ::SOCKET_PUSH,…
Wayne Whitty
  • 19,513
  • 7
  • 44
  • 66
9
votes
3 answers

ZeroMQ REQ/REP server error handling

I am trying to use the ZeroMQ rep/req and cannot figure out how to handle server side errors. Look at the code from here: socket.bind("tcp://*:%s" % port) while True: # Wait for next request from client message = socket.recv() print…
Tom Bennett
  • 2,305
  • 5
  • 24
  • 32
9
votes
2 answers

ZeroMQ with node.js pipeline sink stops receiving messages after a while

I've been trying to set up a ventilator / worker / sink pattern in order to crawl pages, but I never got past the testing phase. The one particularity of my setup is that the sink lives in the same process as the ventilator. All nodes use ipc://…
Floby
  • 2,306
  • 17
  • 15
9
votes
2 answers

ZMQ Compilation problems for C++ examples

I am trying to compile the ZMQ C++ source code examples provided at zmq.org (i.e. github.com/imatix/zguide.git). My OS is xubuntu and I installed ZMQ prerequisites which are libtool, autoconf, automake and uuid-dev package properly. I installed czmq…
F. Aydemir
  • 2,665
  • 5
  • 40
  • 60
9
votes
1 answer

ZeroMQ PUB/SUB - why won't multiple subscribers work?

I'm using ZeroMQ to facilitate a publish/subscribe environment I'm needing. I'm running a publish server on machine A using Python (using EventLoop), and right now I have one subscriber running in C++ on machine B and a second subscriber running in…
Bryan
  • 2,205
  • 1
  • 23
  • 43
9
votes
1 answer

Is ZeroMQ ready for production use?

The same question was asked 1 year ago here. I'm looking for a status update for today. How are the error messages, documentation, etc? Are there frequent bugs which cause development problems? How is the performance?
stevenl
  • 6,736
  • 26
  • 33
8
votes
4 answers

Should I close zeromq socket explicitly in python?

In C/C++ like languages, closing zeromq socket explicitly is a must, which I understand. But in some higher level languages, such as php and python, which have garbage collection mechanism, do I need to close the sockets explicitly? In php, there is…
Jerry
  • 789
  • 1
  • 13
  • 31
8
votes
2 answers

Python ZeroMQ PUSH/PULL -- Lost Messages?

I am trying to use python with zeroMQ in PUSH / PULL mode, sending messages of size 4[MB] every few seconds. For some reason, while it looks like all the messages are sent, ONLY SOME of them appear to have been received by the server. What am I…
user3262424
  • 7,223
  • 16
  • 54
  • 84
8
votes
1 answer

How can i write my own RPC Implementation for Protocol Buffers utilizing ZeroMQ

According to the Google Protocol Buffers documentation under 'Defining Services' they say, it's also possible to use protocol buffers with your own RPC implementation. To my understanding, Protocol Buffers does not implement RPC natively.…
Vpaladino
  • 320
  • 2
  • 12
8
votes
2 answers

How to have limited ZMQ (ZeroMQ - PyZMQ) queue buffer size in python?

I'm using pyzmq library with pub/sub pattern. I have some fast ZMQ publishers using .connect() method and a slower ZMQ subscriber using .bind() method. Then after a few minutes, my subscriber receives the old data published from the publisher — due…
Benyamin Jafari
  • 27,880
  • 26
  • 135
  • 150
8
votes
2 answers

ZeroMQ XPUB/XSUB Serious Flaw?

It seems as though the XPUB/XSUB socket types have a serious flaw that is difficult to work around: This is my implementation of that center node: #include int main() { zmq::context_t context(1); //Incoming publications come…
Gillespie
  • 5,780
  • 3
  • 32
  • 54
8
votes
1 answer

Why websockets stop broadcasting after some time? ( implementation uses ReactPHP, Ratchet & ZeroMQ )

I have a small websocket server, running on top of a set of libraries: ReactPHP, Ratchet and ZeroMQ, using a php-zmq wrapper. The code is basically the same as in the tutorials. The eventloop starts correctly, users are able to connect to the…
Finwe
  • 6,372
  • 2
  • 29
  • 44
8
votes
2 answers

How to handle a Thread Issue in ZeroMQ + Ruby?

Stumble upon reading ZeroMQ FAQ about a Thread safety. My multi-threaded program keeps crashing in weird places inside the ZeroMQ library. What am I doing wrong? ZeroMQ sockets are not thread-safe. This is covered in some detail in the Guide. The…
Viren
  • 5,812
  • 6
  • 45
  • 98
8
votes
1 answer

ZeroMQ design decisions

In a REQ/REP socket, if the socket send a request to a dead (disconnected) node the message isn't delivered and stays in a message queue occupying memory. How can one clean these undelivered messages (let's say, messages that are in the queue for…
carlosalbertomst
  • 513
  • 6
  • 18
8
votes
1 answer

How to set up [ ZeroMQ ] for use in a Visual Studio 2015 Enterprise?

While my primary domain of expertise is not Visual Studio 2015 setup / project configuration, I have experienced troubles on loading / configuring ZeroMQ project. How to proceed correctly on loading a ZeroMQ Project? Observed errors: current build…