[rabbitmq-discuss] Exchanges, Routing, and AMQP
0x6e6562 at gmail.com
Tue Oct 21 09:38:57 BST 2008
On Tue, Oct 21, 2008 at 5:30 AM, Edwin Fine
<rabbitmq-discuss_efine at usa.net> wrote:
> Coincidentally, I did look into rabbit_exchange:route while waiting for your
> response. One (very very minor) thing that struck me on reading it was the
> use of regexp:split/2 to convert "a.dotted.topic.key" to
> ["a","dotted","topic","key"]. I wondered why the more efficient
> string:tokens/2 was not used. They do have different behavior in edge
> conditions (e.g. ".atopic") - was that the reason?
I don't know where that code originated from so I can't comment.
However, if you think that you of a more efficient implementation,
feel free to contribute it. There is a test case for this in the
> Anyway, besides that, for now I'll probably just go with a topic exchange,
> which seems to be the general purpose ancestor of all the others. I really
> do not want to add my code to the Rabbit server side and risk having merge
> difficulties when future releases arise...
Although I am not eagerly encouraging you to go out and hack away at
the internal modules, to be objective, I think that the conciseness of
that module would not necessarily lead to any significant merge
issues. After all, you would just be using Erlang pattern matching to
do the code organization for you.
Another thought crossed my mind as well - to experiment with some kind
of module paramterization or some callback that would separate these
concerns (again with reference to the custom queue discussion - I
think that to do something like this would be a lot more tractable
with exchanges than it would be with queues).
More information about the rabbitmq-discuss