title: ZeroMQ - Handling slow receivers without dropping
body: <p>I have an architecture where I have a <strong><code>ROUTER</code></strong> socket and multiple <strong><code>DEALER</code></strong> sockets.</p>
  
  <p>Some <code>DEALER</code> sockets will only send data, some will only receive data and others can do a mixture of both.</p>
  
  <p>I have a scenario, where I have one <code>DEALER</code> socket, that is sending data at an extremely fast rate. This data is received by another <code>DEALER</code>, that will process this as fast as it can. The send rate is always going to be higher than the receive.</p>
  
  <p>In my current setup the <code>ZMQ_SNDHWM</code> on my <strong><code>ROUTER</code></strong> socket gets hit for the receive client and will silently drop messages. I do not want this to be the case.</p>
  
  <p>What is the best way to do so as to deal with this scenario?</p>
  
  <p>I have looked at <code>DEALER-&gt;DEALER</code> on a different port, but this could be hard to maintain, depending on the number of sessions that are created I could potentially have to have one port per session.</p>
  
  <p>The other way I can think of solving this is to do some pipe-lining in which the receiving <code>DEALER</code> socket will tell the sender when it is ready to receive but this seems to add a lot of complication to the overall protocol and a lot more state management. It also seems to defeat the ability to be able to naturally block on <code>DEALER</code> sockets which is really what I need in this case; the <code>DEALER</code> sockets will never have to communicate with any other socket.</p>