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

ZeroMQ pyzmq send jpeg image over tcp

I am trying to send a jpeg image file through a ZeroMQ connection with pyzmq, but the output is 3 times the size of the input, and no longer a valid jpeg. I load the image and send with... f = open("test1.jpg",'rb') strng =…
user3325088
  • 65
  • 1
  • 4
6
votes
1 answer

Sniffer/monitor in client/server config with ZMQ in Python

I implemented a client/server via ZeroMQ and I would like to add a sniffer/monitor to capture the communication between the two. client <---------> server (REQ) | (REP) | …
flamenco
  • 2,702
  • 5
  • 30
  • 46
6
votes
1 answer

How to downgrade zeromq from version 4.0.4 to 3.2.4

I Have installed zeromq 4.0.4 in my ubuntu machine.i have to downgrade my zmq to 3.2.4. i have tried sudo make uninstall , sudo make clean but none of them worked so far. and i also installed 3.2.4 from source. but still my system showing zmq…
Naveen Subramani
  • 2,134
  • 7
  • 20
  • 27
6
votes
1 answer

ZeroMQ PubSub not working w\ Pyzmq

There is probably something very small that I am missing but I am unable to get a simple pub-sub example working in Python using the official Pyzmq package (https://github.com/zeromq/pyzmq). I am using the latest ZeroMQ stable release 4.0.3 and am…
Stephen
  • 125
  • 1
  • 6
6
votes
1 answer

ZeroMQ: have to sleep before send

I'm write a zeromq demo with Forwarder device (with pyzmq) Here are the codes(reference to https://learning-0mq-with-pyzmq.readthedocs.org/en/latest/pyzmq/devices/forwarder.html ): forwarder.py import zmq context = zmq.Context() frontend =…
wong2
  • 34,358
  • 48
  • 134
  • 179
6
votes
1 answer

zeromq DEALER client to multiple servers (ROUTER)

I am using ZEROMQ for distributed messaging application. Need to connect client (DEALER socket) to multiple servers (ROUTER socket on server side). What are my options on CLIENT side ? Create DEALER socket on client side for each server endpoint…
ashish nagar
  • 69
  • 1
  • 5
6
votes
2 answers

Why one might need JeroMQ if it can use JZMQ?

Simple question. Why "porting" zmq on java and call it JeroMQ is good idea?
6
votes
1 answer

zmq: can multiple threads PUSH in a simple PUSH-PULL pattern

I have two processes: a producer which pushes messages via ZMQ to a consumer in a simple PULL-PUSH point-to-point pattern. The producer has several internal threads that send() via zmq. However, 0MQ's docs suggest not to share sockets between…
Jonathan Livni
  • 101,334
  • 104
  • 266
  • 359
6
votes
2 answers

ZeroMQ multithreading: create sockets on-demand or use sockets object pool?

I'm building a POC leveraging ZeroMQ N-to-N pub/sub model. From our app server, when a http request is serviced, if the thread pulls data from the database, it updates a local memcache instance with that data. To synchronize other memcache instances…
raffian
  • 31,267
  • 26
  • 103
  • 174
6
votes
1 answer

Detecting when ZMQ_RATE limit or ZMQ_SNDHWM have been reached

Is there a way to programatically know when a pgm zeromq socket has stopped forwarding information because the ZMQ_RATE limit has been reached or if it is dropping data because the ZMQ_SNDHWM limit has been reached. There is a zmq_socket_monitor…
user809409
  • 491
  • 7
  • 10
6
votes
1 answer

how to implement Pub-Sub Network with a Proxy by using XPUB and XSUB in ZeroMQ(jzmq) 3.xx

I am trying to implement using XPUB and XSUB as provided in this below figure. I have gone through their examples provided but could not get one for XPUB and XSUB in Java. Here they have given an example in C which is little complex as I am new to…
Ajay Kumar Meher
  • 1,932
  • 16
  • 24
6
votes
2 answers

ZeroMQ, how to connect to external tcp socket?

Can you please tell me how you can use to send messages ZeroMQ between two programs located on different servers using some common socket? With all local sockets program works, but I do not understand how they spread to different places. Because…
Ellochka Cannibal
  • 1,750
  • 2
  • 19
  • 31
6
votes
3 answers

Broadcast to everyone on lan

I am attempting to contact everyone on a LAN to discover which devices are currently using the ip and running my service. Every device running the service will know which other devices are connected when they come online. I have basic networking…
pcb
  • 93
  • 7
6
votes
1 answer

ZeroMQ filtering at publisher

I am looking into using ZeroMQ, and have tried a few examples. However there are a few important requirements that I can't verify that ZeroMQ supports. I hope you can help me. I'll ask my question by using this simple scenario: A publisher (say an…
Peter Andersson
  • 1,947
  • 3
  • 28
  • 44
6
votes
2 answers

What are appropriate settings for ZMQ when sending 500K 64 byte messages?

I have an application that periodically needs to send out a snapshot of its current state, which currently would be represented by about 500,000 64 byte messages. I've been having difficulty getting this many messages sent and received quickly and…
scott
  • 1,127
  • 1
  • 12
  • 21