From 5f935770289255cb5eafaec14e90f3544641ce81 Mon Sep 17 00:00:00 2001 From: nick Date: Tue, 2 Feb 2016 17:50:21 -0800 Subject: [PATCH] Remove existing bindings and replace with new ones when a new binding is created so they stay in sync with Channels --- .../client/impl/recovery/AutorecoveringConnection.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/com/rabbitmq/client/impl/recovery/AutorecoveringConnection.java b/src/com/rabbitmq/client/impl/recovery/AutorecoveringConnection.java index 32e875fce4..b559625fb5 100644 --- a/src/com/rabbitmq/client/impl/recovery/AutorecoveringConnection.java +++ b/src/com/rabbitmq/client/impl/recovery/AutorecoveringConnection.java @@ -638,9 +638,10 @@ synchronized void recordQueueBinding(AutorecoveringChannel ch, destination(queue). routingKey(routingKey). arguments(arguments); - if (!this.recordedBindings.contains(binding)) { - this.recordedBindings.add(binding); + if (this.recordedBindings.contains(binding)) { + this.recordedBindings.remove(binding); } + this.recordedBindings.add(binding); } synchronized boolean deleteRecordedQueueBinding(AutorecoveringChannel ch, @@ -666,6 +667,9 @@ synchronized void recordExchangeBinding(AutorecoveringChannel ch, destination(destination). routingKey(routingKey). arguments(arguments); + if (this.recordedBindings.contains(binding)) { + this.recordedBindings.remove(binding); + } this.recordedBindings.add(binding); }