Skip to content

Closing a channel should cleanup recorded auto-delete queues #669

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 17, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ private void executeAndClean(IoTimeoutExceptionRunnable callback) throws IOExcep
callback.run();
} finally {
for (String consumerTag : consumerTags) {
this.connection.deleteRecordedConsumer(consumerTag);
this.deleteRecordedConsumer(consumerTag);
}
this.connection.unregisterChannel(this);
}
Expand Down Expand Up @@ -644,10 +644,7 @@ public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProp

@Override
public void basicCancel(String consumerTag) throws IOException {
RecordedConsumer c = this.deleteRecordedConsumer(consumerTag);
if(c != null) {
this.maybeDeleteRecordedAutoDeleteQueue(c.getQueue());
}
this.deleteRecordedConsumer(consumerTag);
delegate.basicCancel(consumerTag);
}

Expand Down Expand Up @@ -902,13 +899,12 @@ private void recordConsumer(String result,
this.connection.recordConsumer(result, consumer);
}

private RecordedConsumer deleteRecordedConsumer(String consumerTag) {
private void deleteRecordedConsumer(String consumerTag) {
this.consumerTags.remove(consumerTag);
return this.connection.deleteRecordedConsumer(consumerTag);
}

private void maybeDeleteRecordedAutoDeleteQueue(String queue) {
this.connection.maybeDeleteRecordedAutoDeleteQueue(queue);
RecordedConsumer c = this.connection.deleteRecordedConsumer(consumerTag);
if (c != null) {
this.connection.maybeDeleteRecordedAutoDeleteQueue(c.getQueue());
}
}

private void maybeDeleteRecordedAutoDeleteExchange(String exchange) {
Expand Down