summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@rabbitmq.com>2010-10-15 09:07:30 +0100
committerMatthias Radestock <matthias@rabbitmq.com>2010-10-15 09:07:30 +0100
commit9d0204505ec91746ae7ad5898346064b6c8ed96f (patch)
tree6fd8d9b6f0b71fe8086e677e2a315ffa77ee3344
parentf74597d6c9f6b5d3ee419ec1c5ca3b9a34bb1cb4 (diff)
downloadrabbitmq-server-9d0204505ec91746ae7ad5898346064b6c8ed96f.tar.gz
fire {exchange,binding}_deleted eventsbug23403
-rw-r--r--src/rabbit_binding.erl8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/rabbit_binding.erl b/src/rabbit_binding.erl
index 53c9c663..1af213c4 100644
--- a/src/rabbit_binding.erl
+++ b/src/rabbit_binding.erl
@@ -426,10 +426,14 @@ merge_entry({X1, Deleted1, Bindings1}, {X2, Deleted2, Bindings2}) ->
process_deletions(Deletions) ->
dict:fold(
fun (_XName, {X = #exchange{ type = Type }, Deleted, Bindings}, ok) ->
- TypeModule = type_to_module(Type),
FlatBindings = lists:flatten(Bindings),
+ [rabbit_event:notify(binding_deleted, info(B)) ||
+ B <- FlatBindings],
+ TypeModule = type_to_module(Type),
case Deleted of
not_deleted -> TypeModule:remove_bindings(X, FlatBindings);
- deleted -> TypeModule:delete(X, FlatBindings)
+ deleted -> rabbit_event:notify(exchange_deleted,
+ [{name, X#exchange.name}]),
+ TypeModule:delete(X, FlatBindings)
end
end, ok, Deletions).