[zeromq-dev] Exact matching for PUB/SUB

MinRK benjaminrk at gmail.com
Wed Oct 3 19:38:18 CEST 2012


He means that instead of subscribing to '1', you should subscribe to '1|'.
That way your subscription will not match '10|', etc.

for example (Python):

DELIM = b'|'

def subscribe(sub, key):
    sub.setsockopt(zmq.SUBSCRIBE, key + DELIM)

def publish(pub, key, msg):
    pub.send_multipart([key + DELIM, msg])

-MinRK

On Wed, Oct 3, 2012 at 5:15 AM, Serg V. Gulko <s.gulko at gmail.com> wrote:

> **
> Hello Pieter!
>
> Not sure that understand how delimiters like 1| or 10| can help...
> My goal is make sure that message with key "1" will be delivered only to
> socket_1.
> I made small workaround by checking keys on recipient side... It works but
> this is definitely what I want:)
>
> Serg
>
> _______________________________________________
> 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/20121003/9d73ff8f/attachment.htm>


More information about the zeromq-dev mailing list