[zeromq-dev] Formally modelling the publish-subscribe pattern

Kevin Sapper kevinsapper88 at gmail.com
Fri Oct 16 13:39:45 CEST 2020


Hi John,

>
>    - SHALL create a queue when initiating an outgoing connection to a
>    subscriber, and SHALL maintain the queue whether or not the connection is
>    established.
>
> This action is taken when a SUB socket binds to an address and the PUB
socket connects to it.

>
>    - SHALL create a queue when a subscriber connects to it. If this
>    subscriber disconnects, the PUB socket SHALL destroy its queue and SHALL
>    discard any messages it contains.
>
> This action is taken when a PUB socket binds to an address and the SUB
socket connects to it.

>
>
> What is the difference between initiating an outgoing connection to a
> subscriber and a subscriber connecting to a publisher? In the C++ source
> code of my system, a publisher binds to a PUB socket and a subscriber
> connects to the address of a publisher. I guess this sounds more like the
> second point, but I'm not certain.
>
Yes, the second point!

> Did I understand correctly that this message queue between a publisher and
> a subscriber works FIFO? It says that for outgoing messages, "SHALL
> silently drop the message if the queue for a subscriber is full." Does this
> imply that those messages that fit in the queue are delivered in the order
> they were sent in? I take it that the queue being full means that the high
> water mark has been exceeded.
>
When a PUB socket enters the mute state due to having reached the high
water mark for a subscriber, then any messages that would be sent to the
subscriber in question shall instead be dropped until the mute state ends.
The send function does never block for this socket type.

> What is a binary comparison? Is it the same as bitwise comparison? To me,
> "binary comparison" sounds like just comparing two things with each other.
>
It means that the byte content of the first frame is compared against the
bytes of a subscription. Hence a subscription can use any binary prefix not
just characters.

//Kevin

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20201016/8f985edc/attachment.htm>


More information about the zeromq-dev mailing list