Skip to content

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

Open

Description

@gisode

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.

Activity

  1. added 2 commits that reference this issue on Jan 19, 2017
  2. added a commit that references this issue on Apr 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions