Skip to content

Commit 59d36cd

Browse files
Merge pull request #130 from spatula75/rabbitmq-java-client-129
Remove existing bindings and replace with new ones…
2 parents b4eb607 + 5f93577 commit 59d36cd

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/com/rabbitmq/client/impl/recovery/AutorecoveringConnection.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -638,9 +638,10 @@ synchronized void recordQueueBinding(AutorecoveringChannel ch,
638638
destination(queue).
639639
routingKey(routingKey).
640640
arguments(arguments);
641-
if (!this.recordedBindings.contains(binding)) {
642-
this.recordedBindings.add(binding);
641+
if (this.recordedBindings.contains(binding)) {
642+
this.recordedBindings.remove(binding);
643643
}
644+
this.recordedBindings.add(binding);
644645
}
645646

646647
synchronized boolean deleteRecordedQueueBinding(AutorecoveringChannel ch,
@@ -666,6 +667,9 @@ synchronized void recordExchangeBinding(AutorecoveringChannel ch,
666667
destination(destination).
667668
routingKey(routingKey).
668669
arguments(arguments);
670+
if (this.recordedBindings.contains(binding)) {
671+
this.recordedBindings.remove(binding);
672+
}
669673
this.recordedBindings.add(binding);
670674
}
671675

0 commit comments

Comments
 (0)