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
6
votes
3 answers

"Guaranteed Delivery" Messaging - should I use MQTT or ZeroMQ?

We need a lightweight client based messaging solution. We used AMQP, RabbitMQ before, but in C++ we have problems. We would like to choose ZeroMQ with malamuteserver or MQTT ? Our IoT will publish data (45 kb) almost every 5 min. We need to deliver…
2adnielsenx xx
  • 488
  • 1
  • 5
  • 22
6
votes
1 answer

Compiling zeroMQ (0MQ) for use on the iPhone

I'm trying to compile the Objective-C bindings (https://github.com/jeremy-w/objc-zmq) for zeroMQ for use on the iPhone. I've added the "objc-zmq" project as a dependency to the project I want to include it in. Everything compiles, however, none of…
manlycode
  • 421
  • 6
  • 16
6
votes
2 answers

Python 3.6 ZeroMQ (PyZMQ) asyncio pub sub Hello World

I've just started with ZeroMQ and I'm trying to get a Hello World to work with PyZMQ and asyncio in Python 3.6. I'm trying to de-couple the functionality of a module with the pub/sub code, hence the following class setup: Edit 1: Minimized…
NumesSanguis
  • 5,832
  • 6
  • 41
  • 76
6
votes
1 answer

How to know if a ZeroMQ socket is ready?

I have a simple PUSH/PULL ZeroMQ code in Python. It looks like below. def zmqtest(self): print('zmq') Process(target=start_consumer, args=('1', 9999)).start() Process(target=start_consumer, args=('2', 9999)).start() ctx =…
David S.
  • 10,578
  • 12
  • 62
  • 104
6
votes
1 answer

Zmq Context - Should I create another context in a new thread?

I've got several server apps that use a shared ZMQ class I created. Occasionally when these servers process a request, they need to send a message to another ZMQ server. I'm fairly new to ZMQ so I wanted to make sure I understand this correctly. The…
user1324674
  • 384
  • 1
  • 3
  • 12
6
votes
2 answers

How to send image and data string using serialization in ZMQ?

My goal is to send images and data string from a RPi (server) to a client. I use send_json(data) where the data is a dict {'img': img_ls, 'telemetry':'0.01, 320, -10'}. img_ls is the image converted to a list. The problem is that I get len( img_ls )…
JMarc
  • 984
  • 1
  • 13
  • 21
6
votes
1 answer

ZeroMQ hangs in a python multiprocessing class/object solution

I'm trying to use ZeroMQ in Python (pyzmq) together with multiprocessing. As a minmal (not) working example I have a server- and a client-class which both inherit from multiprocessing.Process. The client as a child-process should send a message to…
kernstock
  • 224
  • 2
  • 10
6
votes
3 answers

How to send OpenCV video footage over ZeroMQ sockets?

I've got a simple webcam which I read out using OpenCV and I'm now trying to send this video footage to a different (Python) program using ZeroMQ. So I've got the following simple script to read out the webcam and send it using a ZeroMQ…
kramer65
  • 50,427
  • 120
  • 308
  • 488
6
votes
1 answer

ZeroMQ buffer size v/s High Water Mark

In the zeromq socket options, we have flags for both a high water mark and a buffer size. For sending, it's ZMQ_SNDHWM and ZMQ_SNDBUF. Can someone explain the difference between these two?
CR7
  • 125
  • 1
  • 10
6
votes
2 answers

Can anyone explain the request-reply broker zeromq example?

I'm refering to the 'A Request-Reply Broker' in the Zeromq documentation: http://zguide.zeromq.org/chapter:all I'm getting the general gist of the app: it acts like an intermediary and routes messages from the client to the server and back…
Toad
  • 15,593
  • 16
  • 82
  • 128
6
votes
2 answers

Which bi-directional ZeroMQ pattern should I use for multiple clients connecting to a single server?

I have multiple ( 1000s ) of clients connecting to a single server and sending some log data. The server analyses the data and responds, if necessary. PUB/SUB is one directional (monitor example ). REQ/REP cannot identify the peer and reply…
Victor
  • 427
  • 1
  • 6
  • 19
6
votes
1 answer

How to start IPython kernel and connect using ZMQ sockets?

I am working on a frontend to IPython in C++ (Qt). I managed to embed Python in my application and retrieve plots and show these in my GUI. Now I want to start an IPython kernel and connect to it through ZMQ sockets. I found a description for the…
tcpie
  • 321
  • 1
  • 3
  • 17
6
votes
1 answer

Dealer (Server) to Dealer (Worker) Not Working

In the following DEALER to DEALER connection, the Worker DEALER sends [][Foo!], i.e. a 2-frame message, to the Server DEALER. package net.async import org.zeromq.ZMQ import org.zeromq.ZMQ.Socket class Worker(name: String) extends Runnable { …
Kevin Meredith
  • 41,036
  • 63
  • 209
  • 384
6
votes
2 answers

NetMQ vs clrzmq

Months ago I was selecting .NET library to use for implementing ZeroMQ communication, and I was pretty confused with the fact that there are few libraries suggested at zeromq.org. Meanwhile I've learned few things, so I'll share here. Someone may…
Aleksandar Pesic
  • 668
  • 7
  • 18
6
votes
2 answers

How to transfer a float array (without serializing/deserializing) from Scala (JeroMQ) to C (ZMQ)?

Currently, I am using a JSON library to serialize the data at the sender (JeroMQ), and deserialize at the receiver (C, ZMQ). But, while parsing, the JSON library starts to consume a lot of memory and the OS kills the process. So, I want to send the…
user1274878
  • 1,275
  • 4
  • 25
  • 56