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

ZMQ C++ Req to Router issues

I am using ZeroMQ for my network layer and so far everything works except when it comes to ROUTER sockets. In particular I receive the expected message on the ROUTER but when I try send an answer back to my REQ socket the message is never…
user3228912
  • 209
  • 2
  • 6
7
votes
1 answer

socket handle leak in pyzmq?

Hi good people of StackOverflow. I'm using pyzmq and I've got some long-running processes, which led to a discovery that socket handles are being left open. I've narrowed the offending code down to the following: import zmq uri =…
Cari
  • 997
  • 1
  • 10
  • 16
7
votes
3 answers

Is application level heartbeating preferable to TCP keepalives?

Is there a reason why I should use application level heartbeating instead of TCP keepalives to detect stale connections, given that only Windows and Linux machines are involved in our setup?
Alex Grönholm
  • 5,563
  • 29
  • 32
7
votes
2 answers

Ratchet / When.js: "Uncaught ReferenceError: module is not defined"

I'm trying to use ratchet for reflecting the changes made to my database realtime. I used the code of the pusher app (http://socketo.me/docs/push). But i am getting error in that. The moment I open the client side page : Uncaught ReferenceError:…
Ashish
  • 679
  • 7
  • 19
7
votes
1 answer

Termination of python script while using ZeroMQ with dead server

I have a problem in closing python application while I using ZeroMQ. first I connect to a server that is not running! context = zmq.Context() socket = context.socket(zmq.REQ) socket_id = randomID() socket.setsockopt(zmq.IDENTITY,…
GTavasoli
  • 448
  • 4
  • 11
7
votes
1 answer

Connect to first free port with TCP using 0MQ

I'm writing a distributed search algorithm in which agents need to listen on a TCP socket for incoming connections. At some point, the agent should bind a free TCP port. Port number is not important but agent should send his/her listening port…
sorush-r
  • 10,490
  • 17
  • 89
  • 173
7
votes
1 answer

ZMQ poll not working

When I run the following code, I get an error on the first call to zmq_poll (i.e. it returns -1). The zmq_errno() returns 128 and the zmr_strerror(128) call returns "Unknown error". I have been using ZMQ with C++ for a while now without any…
Timothy Shields
  • 75,459
  • 18
  • 120
  • 173
7
votes
1 answer

Does ZMQ expose any internal logging? If so, how do you use it?

I've found references in a few places to some internal logging capabilities of ZMQ. The functionality that I think might exist is the ability to connect to either or both of a inproc or ipc SUB socket and listen to messages that give information…
scott
  • 1,127
  • 1
  • 12
  • 21
7
votes
1 answer

ZMQ_DONTWAIT flag does not work?

I am using ZeroMQ for networking in my appliction, the manual states that by providing the ZMQ_DONTWAIT flag to the flags parameter in send or recv causes the function to not block the thread. Yet it doesn't work in my case somehow: …
user1182183
7
votes
1 answer

ZeroMQ: asynchronous replies

I'm building an infrastructure (in C) where several seperate services communicate trough ZeroMQ. Now, in order to make this all running fast and smoothly, I want ZeroMQ to run asynchronously. I know that ZeroMQ's IO-thread already is separated, but…
cutsoy
  • 10,127
  • 4
  • 40
  • 57
7
votes
1 answer

ZeroMQ - Multiple Publishers and Listener

I'm just starting understanding and trying ZeroMQ. It's not clear to me how could I have a two way communication between more than two actors (publisher and subscriber) so that each component is able both to read and write on the MQ. This would…
user1978591
  • 229
  • 1
  • 5
  • 14
7
votes
2 answers

Middleware to build data-gathering and monitoring for a distributed system

I am currently looking for a good middleware to build a solution to for a monitoring and maintenance system. We are tasked with the challenge to monitor, gather data from and maintain a distributed system consisting of up to 10,000 individual…
7
votes
2 answers

Install & Compile ZeroMQ/ZMQ/0MQ on Ubuntu 12.04 32bit

I really want to use 0MQ for a personal project, but I am having a very tough time getting things to compile after installation Here is what I do: #### Install prerequisites without errors: #### $ sudo apt-get install libtool autoconf automake…
Steven Leimberg
  • 785
  • 1
  • 4
  • 18
7
votes
2 answers

Simple wire protocol, what's a guy to do?

I have a simple server written in C. It's main purpose is to communicate with some business partners over a proprietary protocol. For that reason and a few others, it must be written in C. I have a number of other processes, however, written in…
brooks94
  • 3,836
  • 4
  • 30
  • 57
7
votes
1 answer

Is RabbitMQ, ZeroMQ, Service Broker or something similar an appropriate solution for creating a high availability database webservice?

I have a CRUD webservice, and have been tasked with trying to figure out a way to ensure that we don't lose data when the database goes down. Everyone is aware that if the database goes down we won't be able to get "reads" but for a specific subset…
Alex C
  • 16,624
  • 18
  • 66
  • 98