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 | 37d13274339d3a287a10c47be625ff5b53a654f1 (patch) | |
tree | 4a2c19923029022ffe0a7637c139de68bce34c1b | |
parent | b5fe7a473369f4f7a893f130959fc7a4a8227d0c (diff) | |
download | rabbitmq-server-37d13274339d3a287a10c47be625ff5b53a654f1.tar.gz |
fix typo that prevented correct handling of RABBITMQ_SERVER_ERL_ARGS
-rwxr-xr-x | scripts/rabbitmq-server | 4 | ||||
-rw-r--r-- | src/rabbit_exchange.erl | 14 |
2 files changed, 13 insertions, 5 deletions
diff --git a/scripts/rabbitmq-server b/scripts/rabbitmq-server index bb65d64d..572262c9 100755 --- a/scripts/rabbitmq-server +++ b/scripts/rabbitmq-server @@ -38,8 +38,8 @@ [ "x" = "x$RABBITMQ_NODE_IP_ADDRESS" ] && RABBITMQ_NODE_IP_ADDRESS=0.0.0.0 [ "x" = "x$RABBITMQ_NODE_PORT" ] && RABBITMQ_NODE_PORT=${NODE_PORT} [ "x" = "x$RABBITMQ_NODE_PORT" ] && RABBITMQ_NODE_PORT=5672 -[ "x" = "x$RABBITMQ_SERVER_ERL_ARGS" ] && RABBITMQ_ERL_ARGS=${SERVER_ERL_ARGS} -[ "x" = "x$RABBITMQ_SERVER_ERL_ARGS" ] && RABBITMQ_ERL_ARGS="+K true +A30 \ +[ "x" = "x$RABBITMQ_SERVER_ERL_ARGS" ] && RABBITMQ_SERVER_ERL_ARGS=${SERVER_ERL_ARGS} +[ "x" = "x$RABBITMQ_SERVER_ERL_ARGS" ] && RABBITMQ_SERVER_ERL_ARGS="+K true +A30 \ -kernel inet_default_listen_options [{nodelay,true},{sndbuf,16384},{recbuf,4096}] \ -kernel inet_default_connect_options [{nodelay,true}]" [ "x" = "x$RABBITMQ_CLUSTER_CONFIG_FILE" ] && RABBITMQ_CLUSTER_CONFIG_FILE=${CLUSTER_CONFIG_FILE} diff --git a/src/rabbit_exchange.erl b/src/rabbit_exchange.erl index 299747d1..5388d266 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) -> |