In basicCancel:
public void basicCancel(String consumerTag) throws IOException {
RecordedConsumer c = this.deleteRecordedConsumer(consumerTag);
this.maybeDeleteRecordedAutoDeleteQueue(c.getQueue());
delegate.basicCancel(consumerTag);
}
For a consumerTag that isn't actually known for any reason, this.deleteRecordedConsumer will return null. When c.getQueue() is called in the following line, a NullPointerException is thrown.
It would be more desirable to null-check 'c' and throw an appropriate subclass of IOException indicating that the Consumer does not exist / is not known, or do nothing, whichever makes more sense to be orthogonal with the non-recovering version of Channel.
See also https://groups.google.com/forum/#!topic/rabbitmq-users/nIpvcQh4M1M
In basicCancel:
For a consumerTag that isn't actually known for any reason, this.deleteRecordedConsumer will return null. When c.getQueue() is called in the following line, a NullPointerException is thrown.
It would be more desirable to null-check 'c' and throw an appropriate subclass of IOException indicating that the Consumer does not exist / is not known, or do nothing, whichever makes more sense to be orthogonal with the non-recovering version of Channel.
See also https://groups.google.com/forum/#!topic/rabbitmq-users/nIpvcQh4M1M