[zeromq-dev] Order by which PUB/SUB requests are sent/processed

Gary Wright at2002+zmq at me.com
Sun Jan 29 01:47:50 CET 2012


On Jan 24, 2012, at 10:29 PM, Joegen Baclor wrote:
> Interesting read but it requires that the clients have a birds eye view 
> of the hash ring which IMO is an over kill for what we want to achieve.  
> I think this approach is better done if the server is doing the 
> spreading.  I would gladly settle for X_REQ/X_REP to achieve that but 
> unfortunately the dealer/router model does not fit the bill for this 
> particular app.  I do have control over the queue where the tasks are 
> popped and i think this is the best place to spread the load evenly and 
> the hash ring approach might just be what we need to achieve it.   I 
> really appreciate the input.

Maybe I'm missing a detail, but in your use case it would seem like a
simple hash is all that is needed.

If all three workers know their own identity (0, 1, 2) a simple hash
of the message mod 3 should let them determine who should pop the
message off the queue and who should go do something else.

Gary Wright



More information about the zeromq-dev mailing list