[zeromq-dev] PUSH/PULL lost messages (once again)
A. Mark
gougolith at gmail.com
Fri Mar 8 17:22:01 CET 2013
Hi!
In your code the argv[1] "link" must be independently "PUSHED/PULLED" for
this example to give reliable results. Not sure what you do in the
push()/pull() calls but in general your workers and the "collector" are
separate processes. Here you are assuming that the first for loop will not
block at some point which is not true in general, same for the second loop.
The argv[2] link will not transmit any messages until it is connected, and
yes ZMQ will queue messages so it may appear that you have sent messages
even if the endpoint is not connected.
-Mark
On Fri, Mar 8, 2013 at 2:58 AM, Pieter Hintjens <ph at imatix.com> wrote:
> On Fri, Mar 8, 2013 at 11:42 AM, Jean-François Smigielski
> <jf.smigielski at gmail.com> wrote:
>
> > To check error cases, in the same test program (here below) I voluntarily
> > connected a PUSH'er to 2 tcp URL, one valid and one that never existed
> (and
> > won't ever).
>
> When you connect, you create a queue for outgoing messages, which will
> be delivered when the connection succeeds.
>
> In your design this is guaranteed to lose 50% of messages.
>
> If you bind the PUSH and connect the PULL to it, you won't lose
> messages. This is the normal design when you have N workers, where
> some may disappear randomly.
>
> -Pieter
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20130308/e3bf66f4/attachment.htm>
More information about the zeromq-dev
mailing list