Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

N to N async pattern in ZeroMQ?

Tags:

zeromq

although I went through the guide I cant find a way to do the following:
we have n publishers,
we have m subscribers.
Each subscriber subscribes to certain type of msg(one publisher can send more than one kind of the message, multiple pubs can emit msgs of same type).
How to create N to N(or N to 1 to N) pattern in 0MQ that does that?

like image 343
NoSenseEtAl Avatar asked Sep 04 '12 13:09

NoSenseEtAl


2 Answers

Pattern? A publisher will accept any number of subscribers, and your subscribers can connect to multiple publishers. I don't see any issue here, just go ahead and do it.

In the future, perhaps you'll be better served by stating what you want to accomplish, rather than how you think it should be done. Just hooking up a bunch of subscribers to a bunch of publishers might not be the best way to go about whatever it is that you're doing.

like image 60
eevar Avatar answered Oct 26 '22 16:10

eevar


0MQ automatically allows N to M networks; just connect each subscriber to each publisher. That can become a burden to manage, in which case you can use a simple proxy that all publishers and subscribers connect to, see http://zguide.zeromq.org/page:all#toc36.

like image 42
Pieter Hintjens Avatar answered Oct 26 '22 16:10

Pieter Hintjens