diff options
author | Matthew Sackman <matthew@rabbitmq.com> | 2010-06-08 16:39:26 +0100 |
---|---|---|
committer | Matthew Sackman <matthew@rabbitmq.com> | 2010-06-08 16:39:26 +0100 |
commit | 6f0c1c01e078b134db75dde900e28def217908d3 (patch) | |
tree | 41c287fec41baebfe784a363b7f47ac11d54e25f | |
parent | e729c1b0d31c4e8e528643c7b72199bf2108ad29 (diff) | |
parent | 4cf1973200b316f57f50074dc5c2612e097e5baa (diff) | |
download | rabbitmq-server-6f0c1c01e078b134db75dde900e28def217908d3.tar.gz |
Merging bug 21841 onto default
-rw-r--r-- | src/rabbit_channel.erl | 4 | ||||
-rw-r--r-- | src/rabbit_exchange.erl | 24 |
2 files changed, 11 insertions, 17 deletions
diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl index 9127c44b..f355bef3 100644 --- a/src/rabbit_channel.erl +++ b/src/rabbit_channel.erl @@ -934,10 +934,6 @@ binding_action(Fun, ExchangeNameBin, QueueNameBin, RoutingKey, Arguments, not_found, "no binding ~s between ~s and ~s", [RoutingKey, rabbit_misc:rs(ExchangeName), rabbit_misc:rs(QueueName)]); - {error, durability_settings_incompatible} -> - rabbit_misc:protocol_error( - not_allowed, "durability settings of ~s incompatible with ~s", - [rabbit_misc:rs(QueueName), rabbit_misc:rs(ExchangeName)]); ok -> return_ok(State, NoWait, ReturnMethod) end. diff --git a/src/rabbit_exchange.erl b/src/rabbit_exchange.erl index d237134f..99799f7a 100644 --- a/src/rabbit_exchange.erl +++ b/src/rabbit_exchange.erl @@ -76,7 +76,7 @@ -spec(publish/2 :: (exchange(), delivery()) -> {routing_result(), [pid()]}). -spec(add_binding/5 :: (exchange_name(), queue_name(), routing_key(), amqp_table(), inner_fun()) -> - bind_res() | {'error', 'durability_settings_incompatible'}). + bind_res()). -spec(delete_binding/5 :: (exchange_name(), queue_name(), routing_key(), amqp_table(), inner_fun()) -> bind_res() | {'error', 'binding_not_found'}). @@ -375,19 +375,17 @@ add_binding(ExchangeName, QueueName, RoutingKey, Arguments, InnerFun) -> fun (X, Q, B) -> %% this argument is used to check queue exclusivity; %% in general, we want to fail on that in preference to - %% failing on e.g., the durability being different. + %% anything else InnerFun(X, Q), - if Q#amqqueue.durable and not(X#exchange.durable) -> - {error, durability_settings_incompatible}; - true -> - case mnesia:read({rabbit_route, B}) of - [] -> - sync_binding(B, Q#amqqueue.durable, - fun mnesia:write/3), - {new, X, B}; - [_R] -> - {existing, X, B} - end + case mnesia:read({rabbit_route, B}) of + [] -> + sync_binding(B, + X#exchange.durable andalso + Q#amqqueue.durable, + fun mnesia:write/3), + {new, X, B}; + [_R] -> + {existing, X, B} end end) of {new, Exchange = #exchange{ type = Type }, Binding} -> |