IPWorks MQ 2020 Node.js Edition

Questions / Feedback?

UnbindQueue Method

Removes a previously-created queue binding.

Syntax

amqpclassic.unbindQueue(channelName, queueName, exchangeName, routingKey, [callback])

Callback

The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).

The callback for this method is defined as:

function(err){ }

'err' is the error that occurred. If there was no error, then 'err' is 'null'.

'err' has 2 properties which hold detailed information:

err.code
err.message

Remarks

This method removes a previously-created queue binding.

ChannelName controls what channel the class will send the request over. While any channel can technically be used, keep in mind that the server will close it if a channel error occurs. For this reason, it is good practice to make requests such as this one using a channel that is not involved in message publishing or consumption.

QueueName must be a non-empty string consisting only of letters, digits, hyphens, underscores, periods, and colons. It must be no longer than 255 characters.

The server's default exchange may be specified by passing empty string for ExchangeName. Otherwise, ExchangeName must be a non-empty string consisting only of letters, digits, hyphens, underscores, periods, and colons. It must be no longer than 255 characters.

RoutingKey should be the same routing key used when originally creating the binding that is to be removed. For bindings created using arguments instead of a routing key, the Argument* properties must contain the same items used originally instead.

An exception is thrown if no channel with the given ChannelName exists, or if the server returns an error because:

  • No queue with the given QueueName exists. (Does not apply to RabbitMQ.)
  • No exchange with the given ExchangeName exists. (Does not apply to RabbitMQ.)

Note that in AMQP, server errors are grouped into "connection errors" and "channel errors", and both are fatal. That is, if the server returns a channel error, it will then close the channel which caused the error; and if it returns a connection error, it will then close the connection. The AMQPClassic class's Error Codes page includes AMQP's various connection and channel errors.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks MQ 2020 Node.js Edition - Version 20.0 [Build 8155]