2

Zmq is really fast yet have pair of sockets for each 2 way connection (and for each connection type - such as REQ-REQ and PUB-SUB etc) on each side is a pain for any complex architecture. And so a broker concept comes in.

A broker socket with channels (for exaplle named connection abstractions) that would provide pattern types incapsulation. A way to have one socket opened, on one port, on each machine, and have it doing it all (PUB-SUB, REQ-REP etc) would be grate.

Is out there any way to create such one for all with zmq or some extensions of it?

myWallJSON
  • 9,110
  • 22
  • 78
  • 149

1 Answers1

1

You can't do PUB/SUB and REQ/REP using the same ZMQ sockets, it simply wont work. You can, however, encapsulate logic in a single component to, at the very least, receive messages from different socket types using ZMQ.Poller, here's the Python example, hope it helps...

https://github.com/imatix/zguide/blob/master/examples/Python/mspoller.py

BTW, if you're doing N-to-N PUB/SUB, you should be using a ZMQ proxy/forwarder as an intermediary; otherwise, you run into issues with dynamic discovery, read up here: http://zguide.zeromq.org/page:all#The-Dynamic-Discovery-Problem

raffian
  • 31,267
  • 26
  • 103
  • 174