[zeromq-dev] Router-Delaer or Pub-Sub

Balázs Varga bb.varga at gmail.com
Wed May 9 16:02:41 CEST 2012


I would like to ask for advice which kind of sockets to choose for my
problem. I would like to do some kind of address based routing, what I can
do mainly with a router - dealer, or pub sub way. I have one (web) server
(with many connected clients), and workers. I want to deliver messages to
specified workers ( every worker do the same, so It's a kind of load
balancing, the workers don't do different services ). From the guide it
seems like I should choose router - dealer,( I already done, and it works )
but there's a sentence in The Guide

"Having said all this, using durable sockets is often a bad idea. It makes
senders accumulate entropy, which makes architectures fragile. If we were
making ØMQ again we'd probably not implement explicit identities at all."

which tells me maybe I should use pub - sub instead, becaues with the
router - dealer way when I set the identity I make durable sockets. I use
0mq 2.2, and don't even know what's in 0mq 3.1, what If I want to upgrade
to 0mq v3, do this identity thing changed there?

With pub - sub every worker woud subscribe to its unique id channel, so I
can do the routing. Of course I need an another socket to tell the server
the subscriber id, but it's not a problem, actually it's already there, the
workers use a push - pull to send back some results to te server.

So I think whant I need to do can be solved at least two ways, but don't
know which is the prefered way, which has better in performance.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20120509/3f46141b/attachment.htm>

More information about the zeromq-dev mailing list