[zeromq-dev] Connecting to a different socket after connecting and sending messages to one socket?

Chuck Remes cremes.devlist at mac.com
Fri Nov 19 05:53:41 CET 2010

On Nov 18, 2010, at 3:22 PM, Praveen Baratam wrote:

> Hello All!
> I have a particular situation where client nodes connect to server nodes to solve tasks (PUSH-PULL). At any given point there are many clients (PUSH - Connect) connected to all the available servers (PULL - Bound) and each client distributes task-messages to the servers in a load balanced way. Now for the available number of servers (PULL - Bound) are unable to take the load from the clients and we need to add an extra computing server node (PULL - Bound) so that clients can connect and delegate task-messages to the new server/compute node.
> Which means I have to issue a connect call to the PUSH socket on the client to connect to the newly instantiated server PULL socket endpoint after the client started sending messages to the existing servers' PULL sockets.
> Can it be done?
> Simply put, the logic is as follows:-
> pushSocket - connect to endpoint 1
> pushSocket - connect to endpoint 2
> .....
> pushSocket connect to endpoint M
> send messages through pushSocket to endpoint 1 through endpoint M in a load balanced way
> Add another endpoint, endpoint N into the cluster
> pushSocket - conntect to endpoint N
> send messages through pushSocket to endpoint 1 through endpoint N in a load balanced way
> This is similar to the Task Ventillator example explaining PUSH-PULL pair in the guide except that we have arbitrarily joining and leaving ventillators and also arbitrarily joining and leaving workers.
> Somebody please suggest me if this is possible.

This is definitely possible. Use a Streamer device to act as a centralized "broker" between your PUSH/PULL clients and it will handle the load balancing of N clients to M servers automatically. Clients and servers will be able to join (and leave) without incurring any cost in notifying each client about a new server with which to bind. By binding to the Streamer device, it takes on the responsibility of balancing messages across the available servers.


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

More information about the zeromq-dev mailing list