Skip to content

Commit 76acfa4

Browse files
committed
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.
1 parent 655934d commit 76acfa4

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

src/rabbit_amqqueue.erl

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -437,8 +437,7 @@ internal_declare(Q = #amqqueue{name = QueueName}, false) ->
437437
not_found -> Q1 = rabbit_policy:set(Q),
438438
Q2 = Q1#amqqueue{state = live},
439439
ok = store_queue(Q2),
440-
B = add_default_binding(Q2),
441-
fun () -> B(), {created, Q2} end;
440+
fun () -> {created, Q2} end;
442441
{absent, _Q, _} = R -> rabbit_misc:const(R)
443442
end;
444443
[ExistingQ] ->
@@ -502,15 +501,6 @@ policy_changed(Q1 = #amqqueue{decorators = Decorators1},
502501
%% mirroring-related has changed - the policy may have changed anyway.
503502
notify_policy_changed(Q1).
504503

505-
add_default_binding(#amqqueue{name = QueueName}) ->
506-
ExchangeName = rabbit_misc:r(QueueName, exchange, <<>>),
507-
RoutingKey = QueueName#resource.name,
508-
rabbit_binding:add(#binding{source = ExchangeName,
509-
destination = QueueName,
510-
key = RoutingKey,
511-
args = []},
512-
?INTERNAL_USER).
513-
514504
lookup([]) -> []; %% optimisation
515505
lookup([Name]) -> ets:lookup(rabbit_queue, Name); %% optimisation
516506
lookup(Names) when is_list(Names) ->

0 commit comments

Comments
 (0)