[rabbitmq-discuss] Routing key questions/suggestions

Brennan Sellner bsellner at seegrid.com
Thu Dec 2 06:05:24 GMT 2010


On Tue, 2010-11-30 at 09:43 -0800, Christian Legnitto wrote:
> Example:
> 
> I'm listening to commit messages from GitHub. My binding is
> github.push.*.mycoolproject, which means I want to listen to all push
> messages by anyone for a project named mycoolproject. If someone's
> github username has a period in it though, I won't see the messages
> (github.push.john.smith.mycoolproject). If I bound with
> github.push.#.mycoolproject I would see the previous message, but I
> might also get messages for other projects with GitHub users that have
> mycoolproject in their username
> (github.push.this.is.mycoolproject.user.project2). I know this isn't
> the best example, but I'm sick and my head is a bit murky ha.

A somewhat hackish solution to this might be to hash (e.g. md5) any
field that can have arbitrary characters in it.  It renders the routing
keys not humanly readable, but does avoid the inserted-special-character
problem, given arbitrary input, at the cost of a (probably unlikely)
hash collision.

This is just a cheap, weak form of separator-escaping, of course.

-Brennan




More information about the rabbitmq-discuss mailing list