Skip to content

Commit 4d94cd5

Browse files
committed
request review changes
1 parent 8476560 commit 4d94cd5

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/main/java/com/rabbitmq/client/impl/ChannelN.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
import com.rabbitmq.client.impl.AMQImpl.Tx;
3838
import com.rabbitmq.utility.Utility;
3939

40+
import org.slf4j.Logger;
41+
import org.slf4j.LoggerFactory;
42+
4043
/**
4144
* Main interface to AMQP protocol functionality. Public API -
4245
* Implementation of all AMQChannels except channel zero.
@@ -49,6 +52,7 @@
4952
*/
5053
public class ChannelN extends AMQChannel implements com.rabbitmq.client.Channel {
5154
private static final String UNSPECIFIED_OUT_OF_BAND = "";
55+
private static final Logger LOGGER = LoggerFactory.getLogger(ChannelN.class);
5256

5357
/** Map from consumer tag to {@link Consumer} instance.
5458
* <p/>
@@ -1275,7 +1279,8 @@ public void basicCancel(final String consumerTag)
12751279
BlockingRpcContinuation<Consumer> k = new BlockingRpcContinuation<Consumer>() {
12761280
@Override
12771281
public Consumer transformReply(AMQCommand replyCommand) {
1278-
((Basic.CancelOk) replyCommand.getMethod()).getConsumerTag(); // just to make sure its the method expected
1282+
if (!(replyCommand.getMethod() instanceof Basic.CancelOk))
1283+
LOGGER.warn("Received reply was not of expected method Basic.CancelOk");
12791284
_consumers.remove(consumerTag); //may already have been removed
12801285
dispatcher.handleCancelOk(originalConsumer, consumerTag);
12811286
return originalConsumer;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,7 @@ void maybeDeleteRecordedAutoDeleteExchange(String exchange) {
805805
// last binding where this exchange is the source is gone, remove recorded exchange
806806
// if it is auto-deleted. See bug 26364.
807807
if((x != null) && x.isAutoDelete()) {
808-
deleteRecordedExchange(exchange);
808+
this.recordedExchanges.remove(exchange);
809809
}
810810
}
811811
}

0 commit comments

Comments
 (0)