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
12
votes
7 answers

Pure java ZeroMQ clients?

I am trying to use ZeroMQ's pub sub messaging, but the client side requires the code to be all Java. I understand that ZeroMQ has a Java binding but that still relies on a c library, therefore I am unable to use it. Is there a ZeroMQ client I can…
fanar
  • 611
  • 3
  • 7
  • 15
12
votes
1 answer

Howto make zeromq PUB/SUB drop old messages instead of new (for realtime feeds)?

Say I have a PUB server that zmq_send()'s realtime messages to SUB client. If client is busy and can not zmq_recv() messages quick enough, then messages will be buffered in client (and/or server). If the buffer grows too large (high water mark) then…
petke
  • 1,345
  • 10
  • 25
12
votes
2 answers

Scaling WebSockets with a Message Queue

I have built a WebSockets server that acts as a chat message router (i.e. receiving messages from clients and pushing them to other clients according to a client ID). It is a requirement that the service be able to scale to handle many millions of…
orcaman
  • 6,263
  • 8
  • 54
  • 69
12
votes
2 answers

Implementing a message bus using ZeroMQ

I have to develop a message bus for processes to send, receive messages from each other. Currently, we are running on Linux with the view of porting to other platforms later. For this, I am using ZeroMQ over TCP. The pattern is PUB-SUB with a…
fortytwo
  • 491
  • 1
  • 5
  • 16
12
votes
1 answer

I don't get the joke

In ZMQ messaging library there is large number of patterns derived from a base "Pirate" pattern. To quote the documentation: I like to call the Pirate patterns (you'll eventually get the joke, I hope). I have a pretty through understanding of…
meawoppl
  • 2,714
  • 1
  • 23
  • 30
12
votes
1 answer

Message bus over ZeroMQ

I'm going to implement a distributed message bus over ZeroMQ and I'm trying to make it as efficient as possible. My requirements are: multiple processes are connected to a bus, some of them are on the same machine, some not. processes can subscribe…
remdezx
  • 2,939
  • 28
  • 49
12
votes
1 answer

ZeroMQ Pub-Sub + Dynamic Discovery without a Mediator

I am testing ZeroMQ as Pub-Sub (service bus style) infra for a medium system. We have about 50 nodes, all of them should be publishers and subscribers. The network is kind of a star topology, but the edges "talk" with each other. We require Dynamic…
dux2
  • 1,770
  • 1
  • 21
  • 27
12
votes
1 answer

Sending messages from other languages to an IPython kernel

Does anyone have any experience of communicating with IPython kernels from outside of Python? If I were trying to send messages from a Python app to an IPython kernel, I'd use the zmq.kernelmanager API. As it is, I'll obviously need to write my own…
Benjamin Hodgson
  • 42,952
  • 15
  • 108
  • 157
12
votes
4 answers

Get TCP address information in ZeroMQ

I want to connect clients to a server using ZeroMQ (java bindings, jzmq), but I need the TCP information badly, for example the TCP/IP address of a client request! The problem is, for being able to announce a service in the network I need to grab…
AlexLiesenfeld
  • 2,872
  • 7
  • 36
  • 57
12
votes
1 answer

How to implement proxy/broker for (X)PUB/(X)SUB messaging in ZMQ?

So I was reading this article on how to create proxy/broker for (X)PUB/(X)SUB messaging in ZMQ. There is this nice picture of what shall architecture look like : But when I look at XSUB socket description I do not get how to forward all…
myWallJSON
  • 9,110
  • 22
  • 78
  • 149
12
votes
2 answers

ZeroMQ Topic Filtering with Pub/Sub (Java binding)

How can I get ZeroMQ to support topics and pattern matching? e.g. stocks.* stocks.appl From my understanding ZeroMQ..the topic will be part of the message so I need someway of separating the topic from the actual message in the subscriber. Whats…
DD.
  • 21,498
  • 52
  • 157
  • 246
12
votes
3 answers

linking to a static 0MQ library in VS

This may be a Visual Studio question more than anything else... I'm trying to build a 0MQ C++ example using VS10 and ZeroMQ 2.2.0. I downloaded the windows sources and tried to follow these instructions in order to build 0MQ statically.…
Jonathan Livni
  • 101,334
  • 104
  • 266
  • 359
11
votes
2 answers

How to fix 'Install tornado itself to use zmq with the tornado IOLoop.' warning in Python

I've been following this (https://developer.ibm.com/tutorials/se-distributed-apps-zeromq-part2/) tutorial for setting up a ZeroMQ client/server setup which uses CurveZMQ to encrypt messages. The code works, however whenever I run either the client…
Logan Davenport
  • 191
  • 1
  • 2
  • 7
11
votes
4 answers

C++ and Python ZeroMQ 4.x PUB/SUB example does not work

I can only find old C++ source examples. Anyways, I did mine, based on them. Here's my publisher in python: import zmq context = zmq.Context() socket = context.socket(zmq.PUB) socket.bind("tcp://*:5563") while True: msg = "hello" …
PPP
  • 1,279
  • 1
  • 28
  • 71
11
votes
1 answer

How to create a Publish / Subscribe architecture using the CZMQ-4.0.2 new zsock API?

I want to create a Publish / Subscribe architecture, using CZMQ-4.0.2, but I am not able to understand how to use the new zsock APIs. Can anyone point me to some examples using the new APIs?
user226869
  • 135
  • 1
  • 6