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
35
votes
2 answers

Berkeley Socket facade for WinRT Networking plausibility?

This is a copy of a post I've sent to the ZeroMQ mailing list. However, the question is raises it not specific to ZeroMQ, but more generally regarding the need for a 'mapping' layer over the networking functionality provided in WinRT to provide a…
34
votes
4 answers

ZeroMQ + Protocol Buffers

ZeroMQ FAQ page suggest use of Google's protobuf as a way to serialise message content. Has anyone see a good usage example? I also need to get the answer to "What is the biggest advantage of serialising messages?" - whether it may be something I…
errordeveloper
  • 6,716
  • 6
  • 41
  • 54
34
votes
1 answer

Accepting output of the socket generated by Python in MQL5

I have created a socket file something like the following and want that the output of the socket must be read by the MQL5. See the following Python code: daemon.py import socket #import arcpy def actual_work(): #val =…
Jaffer Wilson
  • 7,029
  • 10
  • 62
  • 139
34
votes
4 answers

zmq vs redis for pub-sub pattern

redis supports pub-sub zmq also supports pub-sub via a message broker What would be the architectural pros\cons for choosing between them? I'm aiming at points which are beyond the obvious use-case specific performance benchmarking that should be…
Jonathan Livni
  • 101,334
  • 104
  • 266
  • 359
33
votes
3 answers

Is ZeroMQ production ready?

What are your experiences with ZeroMQ as a general purpose messaging middleware? Did you run into any show-stopping bugs or non-obvious "features"? E.g. 2.0 was not flushing messages properly, and the troubleshooting guide seems to give the most…
Alex B
  • 82,554
  • 44
  • 203
  • 280
32
votes
3 answers

Difference between Apache Thrift and ZeroMQ

I understand that Apache Thrift and ZeroMQ are softwares belonging to different categories, and it is not easy to do a comparison since it is an apple to orange comparison. But I don't know why they belong to different categories. Aren't they both…
Joyce Babu
  • 19,602
  • 13
  • 62
  • 97
30
votes
6 answers

node.js performance with zeromq vs. Python vs. Java

I've written a simple echo request/reply test for zeromq using node.js, Python, and Java. The code runs a loop of 100K requests. The platform is a 5yo MacBook Pro with 2 cores and 3G of RAM running Snow Leopard. node.js is consistently an order of…
Scott A
  • 7,745
  • 3
  • 33
  • 46
29
votes
2 answers

RX vs messaging queues like rabbitmq or zeromq?

I'm quite new to these high level concurrency paradigms, and I've started using the scala RX bindings. So I'm trying to understand how RX differs from messaging queues like RabbitMQ or ZeroMQ? They both appear to use the subscribe/publish paradigm.…
Luciano
  • 2,388
  • 1
  • 22
  • 33
28
votes
2 answers

Best practice when using websockets?

I got a webapplication written in Laravel 4. This application makes use of Ratchet and to be more specific, it uses the package Latchet. As a sidenote I am using the following techniques : AutoBahn JS ZeroMQ Ratchet Now I got the following…
Jack Sierkstra
  • 1,414
  • 2
  • 20
  • 42
27
votes
6 answers

Differences between AMQP and ZeroMQ

Recently started looking into these AMQP (RabbitMQ, ActiveMQ) and ZeroMQ technologies, being interested in distributed systems/computation. Been Googling and StackOverflow'ing around, couldn't find a definite comparison between the two. The farthest…
adelbertc
  • 7,270
  • 11
  • 47
  • 70
26
votes
1 answer

What is zmq.ROUTER and zmq.DEALER in python zeromq?

Can anyone tell what are the types of zmq.sockets? In what situation one can use these sockets? The main difference I need is zmq.DEALER and zmq.ROUTER in python zeroMQ? Which type of socket can use these sockets?
user27
  • 1,557
  • 4
  • 16
  • 16
26
votes
3 answers

Recovering from zmq.error.ZMQError: Address already in use

I hit Ctrl-C while running a PAIR pattern (non-blocking client servers) connection with ZMQ. Later when I tried running the REQ-REP (blocking client single server connection) pattern, I keep getting the Address already in use error. I have tried…
Pratik Mandrekar
  • 9,362
  • 4
  • 45
  • 65
25
votes
5 answers

Using ZeroMQ together with Boost::ASIO

I've got a C++ application that is using ZeroMQ for some messaging. But it also has to provide a SGCI connection for an AJAX / Comet based web service. For this I need a normal TCP socket. I could do that by normal Posix sockets, but to stay cross…
Chris
  • 3,265
  • 5
  • 37
  • 50
23
votes
1 answer

Can't get ZeroMQ python bindings to receive messages over IPC

I'm trying to achieve PUB/SUB over IPC. If I changed the code below so that the subscriber binds to "tcp://*:5000" and the publisher connects to "tcp://localhost:5000" it works, but I can't get it to work over IPC. What am I doing…
Kit Sunde
  • 35,972
  • 25
  • 125
  • 179
22
votes
4 answers

ZeroMQ Message Size Length Limit?

Suppose that several machines are interacting together using python's zeroMQ client. These messages are naturally formatted as strings. Is there a limit to the length of a message (string)?
user3262424
  • 7,223
  • 16
  • 54
  • 84