我正在使用amqplib在我的 node.js 服务器中传输消息。
这是我在队列上监听的代码:
channel.consume(queue, handler1, { noAck: true })
现在,我想更新消费者来监听同一个队列
像这样:
channel.consume(queue, handler2, { noAck: true })
我尝试 unbindQueue 或 deleteQueue 但不知道为什么Unhandled rejection IllegalOperationError: Channel closing
会抛出错误