[zeromq-dev] Advice how to implement QoS for ROUTER-ROUTER or ROUTER-DEALER devices.

Artem Vysochyn artem.vysochyn at gmail.com
Tue Sep 24 16:15:52 CEST 2013


I'm working on creating top-notch rpc-framework (further RPCF) on the base
of jzmq/zmq  and faced with serious design issue. Here's the deal, in
my RPCF I'm going to use devices, especially LRU-device (via ROUTER-ROUTER
mechanism), and more trivial FAIR-device (via ROUTER-DEALER mechanism).
Regardless of *-device I inevitably will face the challenge of addressing
some variant of QoS, here's how:

1. ROUTER-ROUTER (LRU-device)
-- remote_client sends request - a message via DEALER
-- request comes to LRU-device: poller.pollin(int) == true
-- now we consume a message from frontend ROUTER, and want to pass it
further via backend ROUTER, ... but we can't because identity_storage
doesn't host suitable identity.
** now we got a problem: we consumed message from socket but couldn't
forward it further. Also we can't drop message because client expecting
reply. So what to do?

2. ROUTER-DEALER (FAIR-device)
-- remote_client sends request - a message via DEALER
-- request comes to FAIR-device: poller.pollin(int) == true
-- now we consume a message from frontend ROUTER, and want to pass it
further via backend DEALER, ... but we can't because HWM is reached, so I
get exception, catch it, and now what?
** now we got a problem: consumed message from frontend, but couldn't
forward it further.
Also we can't drop message because client expecting reply. So what to do?

As you see, there's two main issues: what to do with a message which has
been consumed from socket but wan't passed further because of some
condition (in LRU case -- we failed to find suitable identity, for FAIR
case -- HWM is reached on backend).

Now, I'm here and asking for your advice regarding what to do with a
message?

So far, I implemented  mechanism which sends message back to its original
sender with RETRY_CALL flag, and if receive_timeout wasn't being exceeded
then client sends message again. But is this way to go? Maybe there're some
other approaches which I don't see?


As usual, appreciate for the help in advance,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20130924/10e05e5b/attachment.htm>


More information about the zeromq-dev mailing list