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
643
votes
17 answers

ActiveMQ or RabbitMQ or ZeroMQ or

We'd be interested to hear any experiences with the pros and cons of ActiveMQ vs RabbitMQ vs ZeroMQ. Information about any other interesting message queues is also welcome.
Abie
  • 10,855
  • 6
  • 32
  • 39
85
votes
7 answers

Performance comparison between ZeroMQ, RabbitMQ and Apache Qpid

I need a high performance message bus for my application so I am evaluating performance of ZeroMQ, RabbitMQ and Apache Qpid. To measure the performance, I am running a test program that publishes say 10,000 messages using one of the message queue…
ahsankhan
  • 951
  • 1
  • 7
  • 5
81
votes
4 answers

zeromq: how to prevent infinite wait?

I just got started with ZMQ. I am designing an app whose workflow is: one of many clients (who have random PULL addresses) PUSH a request to a server at 5555 the server is forever waiting for client PUSHes. When one comes, a worker process is…
Jesvin Jose
  • 22,498
  • 32
  • 109
  • 202
75
votes
2 answers

Why doesn't zeromq work on localhost?

This code works great: import zmq, json, time def main(): context = zmq.Context() subscriber = context.socket(zmq.SUB) subscriber.bind("ipc://test") subscriber.setsockopt(zmq.SUBSCRIBE, '') while True: print…
user756428
  • 753
  • 1
  • 5
  • 4
75
votes
6 answers

Why use AMQP/ZeroMQ/RabbitMQ

as opposed to writing your own library. We're working on a project here that will be a self-dividing server pool, if one section grows too heavy, the manager would divide it and put it on another machine as a separate process. It would also alert…
Evil Spork
  • 1,013
  • 2
  • 10
  • 16
69
votes
2 answers

grpc and zeromq comparsion

I'd like to compare somehow capabilities of grpc vs. zeromq & its patterns: and I'd like to create some comparsion (feature set) - somehow - 0mq is "better" sockets - but anyways - if I apply 0mq patterns - I get comparable 'frameworks' I think -…
user3169252
  • 1,139
  • 1
  • 9
  • 13
67
votes
1 answer

difference between pub-sub and push-pull pattern in zeroMq

This two images are from http://zguide.zeromq.org/page:all. What is the difference between this two pattern if we ignore sink in push-pull pattern ? Is there a difference in how a message gets transfer, if yes what is the difference ?
Bhuvan
  • 4,028
  • 6
  • 42
  • 84
62
votes
6 answers

What are zeromq use cases?

Could you give some examples of zeromq?
Sławosz
  • 11,187
  • 15
  • 73
  • 106
57
votes
2 answers

How does zmq poller work?

I am confused as to what poller actually does in zmq. The zguide goes into it minimally, and only describes it as a way to read from multiple sockets. This is not a satisfying answer for me because it does not explain how to have timeout sockets. I…
user1876508
  • 12,864
  • 21
  • 68
  • 105
51
votes
1 answer

ZeroMQ/ZMQ Push/Pull pattern usefulness

In experimenting with the ZeroMQ Push/Pull (what they call Pipeline) socket type, I'm having difficulty understanding the utility of this pattern. It's billed as a "load-balancer". Given a single server sending tasks to a number of workers,…
CNK
  • 1,053
  • 2
  • 11
  • 17
48
votes
1 answer

ZeroMQ vs Crossroads I/O

I am looking into using ZeroMQ as the messaging/transport layer for a fairly large distributed system, mainly targeting monitoring and data collection (many producers, a few consumers). As far as I can see there are currently two different…
Jakob Möllås
  • 4,239
  • 3
  • 33
  • 61
47
votes
3 answers

Differences between ZeroMQ and WebSockets

I'd like to know what the differences are between the ZeroMQ and WebSockets protocols. I know WebSockets was designed for web browser clients, but I'm assuming it can also be used server to server. And, in that case, I'm wondering if it would be…
repalviglator
  • 2,196
  • 4
  • 16
  • 15
46
votes
2 answers

Memory leak when emitting messages with Socket.IO + Node.js + ZMQ

I have three applications talking to each other. A websocket server (1) that accepts connections from browsers, parses url to see what data is required, serves it to client if it has the data in memory, if not asks for it from another application…
Deniz Ozger
  • 2,565
  • 23
  • 27
41
votes
1 answer

Calling OCaml-wrapped ZeroMQ code from signal handler

I've written some OCaml bindings for CZMQ based on the guide at http://www.linux-nantes.org/~fmonnier/ocaml/ocaml-wrapping-c.php, which seem to work pretty well. For example here's zstr_send: CAMLprim value caml_zstr_send(value socket_val, value…
user1494672
  • 504
  • 4
  • 10
36
votes
5 answers

Connecting to a remote IPython instance

I would like to run an IPython instance on one machine and connect to it (over LAN) from a different process (to run some python commands). I understand that it is possible with zmq : http://ipython.org/ipython-doc/dev/development/ipythonzmq.html…
Ohad
  • 1,450
  • 4
  • 18
  • 27
1
2 3
99 100