views:

79

answers:

1

Hi,

In a distributed system with the following data flow:

  1. The client sends a message for a random node in the distributed system.
  2. The node checks if the operation can be performed by him. If not, sends the message to other node. And the process follows until the correct node.

So the system has the following flow:

client -> nodeX -> nodeY -> nodeZ

If I want to send an OK signal to the client (from nodeX), will the process block using ZeroMQ?

Thanks!

A: 

Normally zmq_send does not block, but there are cases where it can block See the overview here , it depends on the socket type you use.

Messages will be queued up if the node you're sending to can't be reached/reads slowly/slow network or transmissions etc. You can set a threshold as to what happens when the message queue(messages not yet delivered) gets to a certain size, that threshold is called ZMQ_HW.

Whether zmq_send() blocks or drops messages when ZMQ_HW messages are queued, you can see in the zmq_socket documentation mentioned above.

nos