Skip to content
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

queue.unbind() blows up when the passed exchange name is not known to the client #445

Open
gisode opened this issue Jan 19, 2017 · 0 comments

Comments

@gisode
Copy link

gisode commented Jan 19, 2017

I have a piece of software that uses queue.bind() to bind a queue to an exchange with a random name. When I receive a message from that queue, I want to unbind the queue from the exchange. For that purpose the message contains the exchange name, which I use with queue.unbind(). This works great.

The problem arises when my software is restarted after the bind but before the unbind because then queue.unbind() blows up in my face. Source code of this function shows that there is no guard against this._bindings[exchangeName] being undefined.

I have a fix and will post a PR. In the meantime, a workaround is to make the exchange known by calling connection.exchange() before calling queue.unbind().

I'm using amqp-0.2.6 and node-6.9.1.

gisode pushed a commit to gisode/node-amqp that referenced this issue Jan 19, 2017
…nd().

Do not touch this._bindings but execute the command against the
connection anyway, assuming that the caller knows what they are
doing.
gisode added a commit to gisode/node-amqp that referenced this issue Jan 19, 2017
…nd().

Do not touch this._bindings but execute the command against the
connection anyway, assuming that the caller knows what they are
doing.
postwait added a commit that referenced this issue Apr 25, 2017
Issue #445: Guard against unknown exchange name in queue.unbind().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant