[zeromq-dev] a pub with multiple subs starting sequentially

Shaofeng Yang syang at catchif.com
Mon Nov 1 08:46:51 CET 2010


Thanks for your quick response, Martin. Do you think it might make it
work once zmq moves to publisher side filtering. in this case, the sub
can register itself first and then gets disconnected. it will receive
the lost messages when it re-connects to the pub later. of course, it
will have limited queue size/time out for the subs.
or what's the best model/implementation for this case.

Thanks again,
James

On Mon, Nov 1, 2010 at 3:33 AM, Martin Sustrik <sustrik at 250bpm.com> wrote:
> Hi James,
>>
>> sub1 connects to the pub at certain point and receives the message
>> sub2 connects to the pub five minutes later but it still can receive
>> the message without being re-published/sent by the pub.
>>
>> I am asking this because zmq has an internal queue and am wondering
>> when the message will be removed from the queue even this message has
>> been read by the first sub.
>> I tried to write a simple program but it seems once the message has
>> been read by the first sub and the second one can not read the
>> message.
>>
>
> There's a separate queue for each subscriber. The queue is created at the
> moment the subscriber connects. Thus there's no way to store messages for
> the subscriber before it connects -- the publisher doesn't even know that
> the consumer in question exists.
>
> Martin
>



More information about the zeromq-dev mailing list