[rabbitmq-discuss] Routing key match algorithms

Jon Brisbin jon at jbrisbin.com
Thu Jun 30 13:55:43 BST 2011

I'm just trying to scratch an intellectual itch here, but I'm trying to figure out how to match routing keys using regexes. 

The problem I see is that, if a consumer issues a regex as a pattern for a subscription, when a message gets published, how do I find out all the regexes I know about that match? Do I loop over all the consumers, asking each one if they match or not? Seems kind of inefficient. 

Just wondering if this problem was known and passed over early on, and the */# mechanism used to get around this problem. 

I also thought about using some text indexing engine (a la lucene) to solve this problem, but if a message gets published with a specific routing key, you'd have to re-run the search attached to the consumers to get an updated list of messages that match a given regex. So there's no benefit from doing that either, so far as I can tell. 


Jon Brisbin 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20110630/76e1baae/attachment.htm>

More information about the rabbitmq-discuss mailing list