Hello,
I started using zeromq for a project and have bee reading the guide (almost
done with chapter 3. There is one occasion where I want to have a REQ client
talk to multiple servers. I don’t plan to use the routing/load balancing
pattern, with the intent to avoid single point of failure. If a server dies,
I’d like the client to switch to a different server to do send-recv.
I have realized recv would block if that very host it’s talking to dies, and my
solution is to set RCVTIMEO to a finite number (and LINGER to a finite number
as well when socket terminates). However, for the send part, I can see send
always seems to go through (I think due to buffering), and the subsequent recv
would time out. This means send is still doing simple round-robin, otherwise
recv would have been smooth, given other servers are healthy. I’m OK with
buffering and send not reporting one server dying, but how can I ask zeromq to
neglect the dead server from the round robin list?
This seems to be the documented behavior from https://zeromq.org/socket-api/
<https://zeromq.org/socket-api/>, but my tests above didn’t reproduce it:
If no services are available, then any send operation on the socket will block
until at least one service becomes available. The REQ socket will not discard
any messages.
Thanks,
Carl
_______________________________________________
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
https://lists.zeromq.org/mailman/listinfo/zeromq-dev