diff options
| author | Matthias Radestock <matthias@lshift.net> | 2008-12-19 21:54:44 +0000 |
|---|---|---|
| committer | Matthias Radestock <matthias@lshift.net> | 2008-12-19 21:54:44 +0000 |
| commit | 2456e07559553e4e6cfc7750b3a122f1e99e0769 (patch) | |
| tree | 4a2c19923029022ffe0a7637c139de68bce34c1b /src | |
| parent | ce6be20c7cc7ee61ead6ed4610543cec028eb5b5 (diff) | |
| download | rabbitmq-server-git-2456e07559553e4e6cfc7750b3a122f1e99e0769.tar.gz | |
fix typo that prevented correct handling of RABBITMQ_SERVER_ERL_ARGS
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_exchange.erl | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/rabbit_exchange.erl b/src/rabbit_exchange.erl index 299747d141..5388d26601 100644 --- a/src/rabbit_exchange.erl +++ b/src/rabbit_exchange.erl @@ -220,6 +220,14 @@ simple_publish(Mandatory, Immediate, {error, Error} -> {error, Error} end. +route(X, R) -> + case get({route, X, R}) of + undefined -> Res = route2(X, R), + put({route, X, R}, Res), + Res; + Other -> Other + end. + %% return the list of qpids to which a message with a given routing %% key, sent to a particular exchange, should be delivered. %% @@ -228,7 +236,7 @@ simple_publish(Mandatory, Immediate, %% current exchange types that is at most once. %% %% TODO: Maybe this should be handled by a cursor instead. -route(#exchange{name = Name, type = topic}, RoutingKey) -> +route2(#exchange{name = Name, type = topic}, RoutingKey) -> Query = qlc:q([QName || #route{binding = #binding{ exchange_name = ExchangeName, @@ -240,10 +248,10 @@ route(#exchange{name = Name, type = topic}, RoutingKey) -> topic_matches(BindingKey, RoutingKey)]), lookup_qpids(mnesia:async_dirty(fun qlc:e/1, [Query])); -route(X = #exchange{type = fanout}, _) -> +route2(X = #exchange{type = fanout}, _) -> route_internal(X, '_'); -route(X = #exchange{type = direct}, RoutingKey) -> +route2(X = #exchange{type = direct}, RoutingKey) -> route_internal(X, RoutingKey). route_internal(#exchange{name = Name}, RoutingKey) -> |
