summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniil Fedotov <hairyhum@gmail.com>2018-09-27 17:23:40 +0100
committerDaniil Fedotov <hairyhum@gmail.com>2018-12-28 17:17:56 +0400
commit76acfa47cc7da7c1b9072747a0a2bb14b51d3094 (patch)
treeb0a3054f9d659845dae7615db53ed8ea8a95c6ed /src
parent655934d4ad9df0808c218571bb823904413faf48 (diff)
downloadrabbitmq-server-git-76acfa47cc7da7c1b9072747a0a2bb14b51d3094.tar.gz
Do not create default bindings for queues.
Routing from default exchange is performed without querying bindings and they cannot be unbound and only show in `rabbitmqctl list_bindings`. There is no point in keeping them and they are slowing down cleanup.
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_amqqueue.erl12
1 files changed, 1 insertions, 11 deletions
diff --git a/src/rabbit_amqqueue.erl b/src/rabbit_amqqueue.erl
index d938bece8c..246397ea28 100644
--- a/src/rabbit_amqqueue.erl
+++ b/src/rabbit_amqqueue.erl
@@ -437,8 +437,7 @@ internal_declare(Q = #amqqueue{name = QueueName}, false) ->
not_found -> Q1 = rabbit_policy:set(Q),
Q2 = Q1#amqqueue{state = live},
ok = store_queue(Q2),
- B = add_default_binding(Q2),
- fun () -> B(), {created, Q2} end;
+ fun () -> {created, Q2} end;
{absent, _Q, _} = R -> rabbit_misc:const(R)
end;
[ExistingQ] ->
@@ -502,15 +501,6 @@ policy_changed(Q1 = #amqqueue{decorators = Decorators1},
%% mirroring-related has changed - the policy may have changed anyway.
notify_policy_changed(Q1).
-add_default_binding(#amqqueue{name = QueueName}) ->
- ExchangeName = rabbit_misc:r(QueueName, exchange, <<>>),
- RoutingKey = QueueName#resource.name,
- rabbit_binding:add(#binding{source = ExchangeName,
- destination = QueueName,
- key = RoutingKey,
- args = []},
- ?INTERNAL_USER).
-
lookup([]) -> []; %% optimisation
lookup([Name]) -> ets:lookup(rabbit_queue, Name); %% optimisation
lookup(Names) when is_list(Names) ->