[zeromq-dev] Pub-Sub Message Envelopes with Sender
Marcin Romaszewicz
marcin at brkt.com
Thu Oct 1 20:31:34 CEST 2015
No it's not possible, because pub-sub filtering only looks at the first
message part.
I do something similar in my own pub/sub system, and I just combine the
first two parts.
So,
msg[0] = 'f1'.'f2'
msg[1] = other stuff
Then, my subscribers just subscribe to 'f1.f2'
If you have a lot of combinations of the two parts, you have to subscribe
to a lot of things, but remember that it's a prefix match.
So, if you subscribe to 'f1', you get all strings that begin with f1.
The harder part is if you want to subscribe to everything that ends with
'f2', since you must subscribe every possible prefix as well. You have to
choose your field ordering intelligently to avoid a combinatorial explosion.
If you can't do that, it might make more sense to do your own pub-sub
routing.
On Thu, Oct 1, 2015 at 11:24 AM, MM <finjulhich at gmail.com> wrote:
> On 29 September 2015 at 17:19, MM <finjulhich at gmail.com> wrote:
>
>> From http://zguide.zeromq.org/py:all, in the section
>> *Pub-Sub Envelope with Sender Address*
>>
>> Assuming the publisher sends a 3-part list/tuple with send_multipart
>> (instead of a 2-part), is it possible for the subscriber to register a
>> filter for messages where msg[0]==b'f1' and msg[1]==b'f2' to say it's
>> only interested in messages of type f1 from publisher f2?
>>
>> Rds,
>>
>>
> I have just seen my message in the archive and it appears with an empty
> body. Perhaps that I had html content in it.
> Here's a plain-text only version, hoping it appears in the archive
> correctly:
>
> From http://zguide.zeromq.org/py:all, in the section
> Pub-Sub Envelope with Sender Address
>
> Assuming the publisher sends a 3-part list/tuple with send_multipart
> (instead of a 2-part), is it possible for the subscriber to register a
> filter for messages where msg[0]==b'f1' and msg[1]==b'f2' to say it's
> only interested in messages of type f1 from publisher f2?
>
> Rds,
>
> _______________________________________________
> 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/20151001/55247955/attachment.htm>
More information about the zeromq-dev
mailing list