8000 basicCancel of invalid cTag on AutorecoveringChannel throws NullPointerException · Issue #105 · rabbitmq/rabbitmq-java-client · GitHub
[go: up one dir, main page]

Skip to content

basicCancel of invalid cTag on AutorecoveringChannel throws NullPointerException #105

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

Closed
spatula75 opened this issue Nov 19, 2015 · 1 comment
Assignees
Milestone

Comments

@spatula75
Copy link

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

@michaelklishin michaelklishin self-assigned this Nov 20, 2015
@michaelklishin michaelklishin added this to the 3.5.7 milestone Nov 20, 2015
michaelklishin added a commit that referenced this issue Nov 20, 2015
@michaelklishin
Copy link
Contributor

Fixed in #106.

stream-iori pushed a commit to stream-iori/rabbitmq-java-client that referenced this issue Mar 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants
0