[zeromq-dev] Watermarks & socket types

Pavel Gushcha pavimus at gmail.com
Tue May 25 10:44:28 CEST 2010

Hi, zmq developers!

I'm began developing  of my client-server apps when no xrep/xreq
sockets was available and ZMQ_HWM/ZMQ_LWM was present, but not
implemented. My clients are asyncronous (it can send multiple
request(s) at one time, and then wait for all or some from
response(s)). When i started developing, the only plausible solution
1) using ZMQ_DOWNSTREAM socket to send request to one from servers,
and include client ID in request.
2) using ZMQ_PUB on server to send responses to topic with client ID
3) using ZMQ_SUB socket, subscribed to client ID for receive responses

As i understand, now zmq has more better solution:
1) using ZMQ_XREQ socket on client for sending multiple requests
without waiting a reply.
2) using ZMQ_XREP socket on server.

This is correct?

Currently, now my old solution is not working properly, when i use
watermarks. When i use low values for watermarks, some messages that
sent to ZMQ_PUB are dropped and not received by ZMQ_SUB. In
documentation i didn't found detailed information about how watermarks
works for different socket types (for some types messages will be
dropped, for other types sending thread will be blocked). Can you get
detailed info about this?

Is there some workaround to prevent message dropping in my old
solution when using watermarks, or i must rewrite all this logic to

Thanks for help!

More information about the zeromq-dev mailing list