summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@rabbitmq.com>2011-10-21 19:01:30 +0100
committerMatthias Radestock <matthias@rabbitmq.com>2011-10-21 19:01:30 +0100
commitca0a3fe5b462f8029ee6c3252b8b889b019f2418 (patch)
treee74db75ebec41579c23e537899a6f775ce9ea802
parent2ffe72b11babe52cbc28c8205015ed6425e65f9a (diff)
parentd532140b40aa0a61a6c045c8f428942719452b09 (diff)
downloadrabbitmq-server-git-ca0a3fe5b462f8029ee6c3252b8b889b019f2418.tar.gz
merge bug24504 into default
-rw-r--r--src/rabbit_exchange.erl10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/rabbit_exchange.erl b/src/rabbit_exchange.erl
index afa483557d..a15b9be490 100644
--- a/src/rabbit_exchange.erl
+++ b/src/rabbit_exchange.erl
@@ -257,6 +257,8 @@ route1(Delivery, {WorkList, SeenXs, QNames}) ->
DstNames))
end.
+process_alternate(#exchange{arguments = []}, Results) -> %% optimisation
+ Results;
process_alternate(#exchange{name = XName, arguments = Args}, []) ->
case rabbit_misc:r_arg(XName, exchange, Args, <<"alternate-exchange">>) of
undefined -> [];
@@ -355,5 +357,9 @@ peek_serial(XName) ->
%% Used with atoms from records; e.g., the type is expected to exist.
type_to_module(T) ->
- {ok, Module} = rabbit_registry:lookup_module(exchange, T),
- Module.
+ case get({xtype_to_module, T}) of
+ undefined -> {ok, Module} = rabbit_registry:lookup_module(exchange, T),
+ put({xtype_to_module, T}, Module),
+ Module;
+ Module -> Module
+ end.