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

examples of zeromq pub/sub with C# winform

I'm trying to create a C# Winform application that uses ZeroMQ (clrzmq .net bindings (x86) via nuget) in a pub/sub model. After much searching, I can only find standalone C# examples where the code uses a while statement to process new messages…
uberdanzik
  • 549
  • 1
  • 7
  • 18
10
votes
2 answers

Detect dropped messages in ZeroMQ Queues

Since it does not seem to be possible to query/inspect the underlying ZeroMQ queues/buffers sockets to see how much they are utilized, is there some way to detect when a message is dropped due to full buffers in a Publisher socket when…
Jakob Möllås
  • 4,239
  • 3
  • 33
  • 61
10
votes
2 answers

Java NIO selector minimum possible latency

I am doing some benchmarks with an optimized Java NIO selector on Linux over loopback (127.0.0.1). My test is very simple: One program sends an UDP packet to another program that echoes it back to the sender and the round trip time is computed. The…
Julie
  • 101
  • 1
  • 5
9
votes
1 answer

Under what circumstances do ZeroMQ sockets drop or fail to deliver messages?

Is there some sort of a specification or other explanation that describes the normal cases where you can expect a message sent on a ZeroMQ socket to not be received by ( all ) the listening processes, for each communication type? For example I have…
Aaron Watters
  • 2,784
  • 3
  • 23
  • 37
9
votes
1 answer

ZeroMQ High Water Mark Doesn't Work

when I read the "Durable Subscribers and High-Water Marks" in zmq guide, it said "The HWM causes ØMQ to drop messages it can't put onto the queue", but no messages lost when I ran the example. Hit ctrl+c to terminate the durasub.py and then…
faicker
  • 635
  • 1
  • 6
  • 8
9
votes
4 answers

How to setup ZeroMQ on Windows to work with OpenPGM?

How to setup ZeroMQ on Windows to work with OpenPGM?
DaveHeller
  • 7,899
  • 3
  • 19
  • 9
9
votes
1 answer

Gearman vs ZeroMQ

Has someone some feedback about distributed architectures with these engines? Which is the best, or in which cases which is the best election? Regards!
Christian
  • 93
  • 1
  • 3
9
votes
2 answers

How to expose a container port outside of docker/container using docker-compose?

I have a container that it has several ports, I want to have access to one of its ports (9001) outside of this docker as remote. My docker IP is: 172.17.0.1 My container IP is: 172.19.0.23 My server IP is: 192.168.1.131 I have searched about that…
Benyamin Jafari
  • 27,880
  • 26
  • 135
  • 150
9
votes
2 answers

ZeroMQ C# Ironhouse example

I am fairly new to ZeroMQ and have been comparing security of messages using the ZeroMQ NuGet package and the NetMQ & NetMQ Security NuGet packages. So far, I have not been able to find a C# version of the Ironhouse example using Curve Security. …
Brian Behm
  • 6,129
  • 1
  • 23
  • 30
9
votes
1 answer

Understanding ZMQ's HWM

I'm having some trouble understanding how the ZeroMQ high-water mark (HWM) queues work. I have made two scripts attached below, which reproduce the following. Stablish a PUSH/PULL connection, Setting all HWM queues to size 1. Make the puller sleep…
Guimo
  • 632
  • 1
  • 7
  • 15
9
votes
3 answers

How to design a system which sends records and retries sending them again, if an acknowledgement is not receieved?

I am working on a project, where I need to consume a lot of records and then I am sending these records to some other system, which uses ZeroMQ. Here is the flow: Store all the incoming records in a CHM from multiple threads. Records will come at…
john
  • 11,311
  • 40
  • 131
  • 251
9
votes
1 answer

How to implement an active & standby queue job-processing system in JeroMQ?

Using ZeroMQ .Context and .Socket instances, I am able to push/pull messages for example below my code for a Queue like setup: ZMQ.Context context = ZMQ.context(1); // Socket to send messages on ZMQ.Socket sender = context.socket(ZMQ.PUSH); …
Abhishek Nayak
  • 3,732
  • 3
  • 33
  • 64
9
votes
2 answers

Adding the ZeroMQ PHP extension to XAMPP on Windows 10 and PHP7

I am having issues adding the ZeroMQ PHP extension to XAMPP. Setup: Windows 10, PHP7, XAMPP (7.0.9) Steps I already took: Added PHP (D:\xampp7\php) and PHP extensions (D:\xampp7\php\ext) directories to system variable (PATH) Followed the…
ju_
  • 569
  • 1
  • 4
  • 17
9
votes
1 answer

Jupyter and Common Lisp

I'm trying to install cl-jupyter (A common-lisp kernel for Jupyter), and I can't make it work: when I open a new lisp notebook (or change the kernel of an existing notebook), it crashes after displaying the following messages: [I 18:26:50.855…
Borbei
  • 219
  • 3
  • 7
9
votes
1 answer

ZeroMQ: Same context for multiple sockets

I am trying to use ZeroMQ's pub-sub sockets. However, I don't clearly understand the role of context (zmq::context_t) while creating sockets (zmq::socket_t). Assuming that I want to create 5 subscriber sockets (zmq::socket_t using ZMQ_SUB), do I…
JhnElaine
  • 93
  • 1
  • 4