[zeromq-dev] Why PUB and SUB sockets don't use multi-part messages?
Luca Boccassi
luca.boccassi at gmail.com
Thu May 31 14:24:31 CEST 2018
On Thu, 2018-05-31 at 16:43 +0530, Dev Aggarwal wrote:
> I recently used ROUTER and DEALER sockets, which used multi-part
> messages
> to separate identity of sender and the message data.
>
> I personally, found this approach quite sophisticated.
>
> But then, I found some use for the PUB and SUB socket pair.
> I was surprised to see the examples in the guide not using multi-part
> messages.
> Instead they used concatenation to append the "TOPIC" to the main
> message
> and then filter out based on that.
>
> Is there a specific reason for doing concatenation, instead of using
> the
> first part of a multi-part message?
>
> Regards,
> Dev
You can use a separate frame (first one) for the topic if you wish. It
will work, but it's not mandatory.
--
Kind regards,
Luca Boccassi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20180531/f80adce8/attachment.sig>
More information about the zeromq-dev
mailing list