[zeromq-dev] Flow control with router socket
Kevin Sapper
kevinsapper88 at gmail.com
Thu May 14 16:18:42 CEST 2020
Hi Gyorgy,
back-pressure is something very specific to your application. ZeroMQ itself
only implements blocking or dropping depending on the socket types you're
using.
To implement a credit-based flow have a look into the guide:
http://zguide.zeromq.org/page:all#Transferring-Files
//Kevin
Am Do., 14. Mai 2020 um 09:55 Uhr schrieb Gyorgy Szekely <
hoditohod at gmail.com>:
> Hi All,
>
> I have a message router that routes messages between different types of
> producers and consumers. Socket types are router (message router), dealer
> (producer, consumer). Currently if a consumer is not fast enough messages
> start to queue up (dealer input queue, router output queue), eventually the
> router starts to drop messages to avoid blocking.
>
> I would like to implement some kind of flow control. With plain TCP I can
> rely on the built-in flow control: write blocks if consumer is overloaded,
> and producers can be sanctioned by not reading their socket.
>
> With ZMQ router/dealer I can detect if a consumer is slow by receiving
> EAGAIN on send, but as far as I understand I can't "slow down" a specific
> producer, because router socket does fair queuing. So I have to do
> application layer "stop sending" and "continue" messages and send them to
> specific producers...
>
> Is there any better way to do this? I would rather not reinvent the wheel,
> TCP already has a sophisticated mechanism for this.
>
> Regards,
> Gyorgy Szekely
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> https://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20200514/dd67f9ae/attachment.htm>
More information about the zeromq-dev
mailing list