Skip to content

Commit ea0c35d

Browse files
committed
Exchanges: use exchange_type module delete/2 callback when deleting exchanges
1 parent 8c8235c commit ea0c35d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

deps/rabbit/src/rabbit_exchange.erl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,11 +471,13 @@ delete(XName, IfUnused, Username) ->
471471
?EXCHANGE_DELETE_IN_PROGRESS_COMPONENT,
472472
XName#resource.name, true, Username),
473473
case rabbit_db_exchange:delete(XName, IfUnused) of
474-
{deleted, #exchange{name = XName} = X, Bs, Deletions} ->
474+
{deleted, #exchange{name = XName, type = XType} = X, Bs, Deletions} ->
475475
Deletions1 = rabbit_binding:add_deletion(
476476
XName, X, deleted, Bs, Deletions),
477477
ok = rabbit_binding:process_deletions(Deletions1),
478478
ok = rabbit_binding:notify_deletions(Deletions1, Username),
479+
{ok, XTypeModule} = rabbit_registry:lookup_type_module(exchange, XType),
480+
ok = XTypeModule:delete(0, X),
479481
ok;
480482
{error, _} = Err ->
481483
Err

0 commit comments

Comments
 (0)