[zeromq-dev] Basic questions about PUB-SUB
Nishant Mittal
nmittal at rblt.com
Fri Apr 26 14:45:13 CEST 2013
Pieter thanks for the answers. on #3..
I am publishing market data (trades & quotes) for all symbols. the
requirement is that a subscriber can subscribe to say
a) everything
b) everything for a symbol (AAPL)
c) all trades for all symbols
d) all quotes for all symbols
e) trades only for a symbol AAPL
the way I was hoping to "solve" this was by adding 2 extra frames to my
payload frame. trades will be marked as "+", quotes with a "-".. so for
example when publishing a trade for AAPL will send out...
frame 1: +AAPL
frame 2: AAPL
frame 3: <pay load>
similarily when publishing a quote ...
frame 1: -AAPL
frame 2: AAPL
frame 3: <pay load>
now for the above use cases the subscriber could subscribe to...
a) ""
b) "AAPL"
c) "+"
d) "-"
e) "+AAPL"
but if the filtering only looks at first frame this clearly wont work.. how
do you suggest I achieve this?
thanks
Nishant
On Fri, Apr 26, 2013 at 8:34 AM, Pieter Hintjens <ph at imatix.com> wrote:
> On Fri, Apr 26, 2013 at 2:19 PM, Nishant Mittal <nmittal at rblt.com> wrote:
> > In a pub sub scenario in 3.2.2
> > 1) does the filtering happen on the Publisher (i think yes) or the
> > Subscriber?
>
> Yes, the publisher filters.
>
> > 2) does number of subscribers effect performance of the publishers (I
> think
> > yes, as the pub has to filter/send msgs to all subscribers)
>
> Not really, your network will saturate before the publisher is affected.
>
> > 3) I send out 3 part msgs.. 1st 2 parts are really for filtering and the
> 3rd
> > part is a binary object.. when I subscribe.. would zeromq try to match
> with
> > all 3 parts?..
>
> No. the match stops at the end of the first frame in the worst case
> (and stops when it mismatches a single octet anyhow).
>
> -Pieter
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
--
*Nishant Mittal*
Director, Product Development
*Rosenblatt Securities Inc*.
20 Broad Street
New York, NY 10005
Direct: 212-607-3159
Mobile: 646-504-2629
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20130426/33befbc9/attachment.htm>
More information about the zeromq-dev
mailing list