[zeromq-dev] Fwd: Exact matching on subscription topics

Martin Sustrik sustrik at 250bpm.com
Thu Jan 19 02:00:18 CET 2012


On 01/19/2012 09:36 AM, john skaller wrote:
>
> On 19/01/2012, at 3:57 AM, Chuck Remes wrote:
>
>>
>> This would provide some room to grow if the library were to ever get a more complex matching mechanism like regular expressions.
>>
>> #define ZMQ_SUBSCRIBE_REGEX_MATCH<int>
>
> No. The way you do this is with a callback. So it becomes more like:
>
> ZMQ_SUBSCRIBE (user_filter_fun, client_data)
>
> this allows the client to write any kind of matcher they like and
> decouples anything but a trivial matching algorithm from ZMQ.
>
> It's not ZMQ's job to perform complex filtering.
> People write massive applications to do this kind of thing!
> Huge huge complex systems! Er .. like Googles search engine .. :)

Yes. Agreed. Complex filtering, even SQL-like filters offered by some 
enterprise middleware implementations, is probably out-of-scope for 0MQ.

However, few simple filtering algorithms (exact, prefix, regexp?) that 
can be performed at wire speed may be in scope.

The question here is how to implement the latter.

The important point is that the filtering algorithm should be 
distributed to every node in the message distribution tree. Thus, 
supplying a callback function at the subscriber won't do.

I suggest reading the past posts in this thread. There's a disucssion of 
the algorithm that would allow for new filtering algorithms that 
wouldn't break the old intermediate nodes not aware of the new algorithm.

Martin




More information about the zeromq-dev mailing list