Skip to content

Commit

Permalink
rabbitmq: clear queue to refresh bindings
Browse files Browse the repository at this point in the history
Change-Id: Ia47d2e66a4696e5632b0d1b53347df054317e41d
  • Loading branch information
DavidGerva committed Jan 15, 2025
1 parent 2ea31d0 commit 2f737bb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/cmk-messaging/cmk/messaging/rabbitmq.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,15 @@ def _start_cleanup_unused_definitions(
}:
yield rabbitmqctl_process(("delete_vhost", vhost), wait=False)

for queue in set(
binding.destination
for binding in old_definitions.bindings
if binding.destination_type == "queue" and binding not in new_definitions.bindings
):
# removed bindings are not correctly actualized in rabbitmq
# we delete the queue to remove the bindings
yield rabbitmqctl_process(("delete_queue", queue), wait=False)

# currently only shovels, but we don't have to care here
for param in set(old_definitions.parameters) - set(new_definitions.parameters):
yield rabbitmqctl_process(
Expand Down

0 comments on commit 2f737bb

Please sign in to comment.