Skip to content

Commit d291d3f

Browse files
committed
channel cleanup
1 parent 815ae9c commit d291d3f

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/main/java/com/rabbitmq/client/impl/recovery/AutorecoveringChannel.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,21 +67,26 @@ public void close() throws IOException, TimeoutException {
6767
try {
6868
delegate.close();
6969
} finally {
70-
for (String consumerTag : consumerTags) {
71-
this.connection.deleteRecordedConsumer(consumerTag);
72-
}
73-
this.connection.unregisterChannel(this);
70+
recoveryCleanup();
7471
}
7572
}
7673

7774
@Override
7875
public void close(int closeCode, String closeMessage) throws IOException, TimeoutException {
7976
try {
80-
delegate.close(closeCode, closeMessage);
77+
delegate.close(closeCode, closeMessage);
8178
} finally {
82-
this.connection.unregisterChannel(this);
79+
recoveryCleanup();
8380
}
8481
}
82+
83+
private void recoveryCleanup() {
84+
for (String consumerTag : consumerTags) {
85+
this.connection.deleteRecordedConsumer(consumerTag);
86+
}
87+
// TODO what about any other recorded queues and bindings that were owned by this channel? They will now cause recovery exceptions.
88+
this.connection.unregisterChannel(this);
89+
}
8590

8691
@Override
8792
@Deprecated

0 commit comments

Comments
 (0)