Skip to content

Commit aa1ae31

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 c1fb658 commit aa1ae31

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
@@ -366,8 +366,7 @@ internal_declare(Q = #amqqueue{name = QueueName}, false) ->
366366
not_found -> Q1 = rabbit_policy:set(Q),
367367
Q2 = Q1#amqqueue{state = live},
368368
ok = store_queue(Q2),
369-
B = add_default_binding(Q1),
370-
fun () -> B(), Q1 end;
369+
fun () -> Q1 end;
371370
{absent, _Q, _} = R -> rabbit_misc:const(R)
372371
end;
373372
[ExistingQ] ->
@@ -422,15 +421,6 @@ policy_changed(Q1 = #amqqueue{decorators = Decorators1},
422421
%% mirroring-related has changed - the policy may have changed anyway.
423422
notify_policy_changed(Q1).
424423

425-
add_default_binding(#amqqueue{name = QueueName}) ->
426-
ExchangeName = rabbit_misc:r(QueueName, exchange, <<>>),
427-
RoutingKey = QueueName#resource.name,
428-
rabbit_binding:add(#binding{source = ExchangeName,
429-
destination = QueueName,
430-
key = RoutingKey,
431-
args = []},
432-
?INTERNAL_USER).
433-
434424
lookup([]) -> []; %% optimisation
435425
lookup([Name]) -> ets:lookup(rabbit_queue, Name); %% optimisation
436426
lookup(Names) when is_list(Names) ->

0 commit comments

Comments
 (0)