Special characters in routing key

789 views
Skip to first unread message

Vijaya Sagar

unread,
Feb 25, 2015, 7:33:32 AM2/25/15
to rabbitm...@googlegroups.com
Greetings ..

We are using routing key to route messages to different exchanges / queues ..
example :  orange.east.critical    will go to exchange/Queue  Queue1

we have a scenario where the word between "."  has some special characters like " ." ."#" "&" etc .. not sure how to handle them when adding bindings ...

Appreciate all the help..

--

Thanks,
Sagar


Michael Klishin

unread,
Feb 25, 2015, 8:13:54 AM2/25/15
to Vijaya Sagar, rabbitm...@googlegroups.com
Encode them using base64 or similar. Not all exchange types use patterns, by the way.

MK
--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Laing, Michael

unread,
Feb 26, 2015, 8:52:56 AM2/26/15
to Michael Klishin, Vijaya Sagar, rabbitm...@googlegroups.com
Just thinking about this...

We use complex patterns in our topics and bindings, and can't always control what our internal users provide...

Plus we have equivalence between our Cassandra db keys, MQTT topics, and the RabbitMQ topics/bindings - so we are always transforming them among different representations.

And we want the topics to be easily readable in the RabbitMQ management UI and elsewhere (no base64).

So we have come down to 2 tactics:
  1. Percent encoding: internal users understand this, e.g. a period becomes '%2E'. Possibly ambiguous...
  2. Encoding with Unicode private use code points in the Basic Multilingual Plane. Huh?
Topics/bindings are utf-8, so you can, for example, encode/decode a period to/from U+E000 unambiguously, and so forth for '+' and '#'.

It will display with a funny glyph. A good intern project would be to add distinctive glyphs, e.g. a bolded glyph of the character being replaced.

There are 6400 code points in the 1st private use area - we also use them to represent standard phrases like 'New York Times' or 'your credit card has expired' :)

ml
Reply all
Reply to author
Forward
0 new messages