(406, 'PRECONDITION_FAILED - unknown delivery tag 1') Rabbitmq

使用Rabbitmq消费者进行消费时,遇到错误信息

(406, 'PRECONDITION_FAILED - unknown delivery tag 1')

解决方案:当前消费者需要在接收到消息时,进行ack回复,auto_ack=False表示消费者拿到消息后自动回复

    channel.basic_consume(channel.callback_success, queue, auto_ack=False)
    channel.start_consuming()

参考文档:https://www.grzegorowski.com/rabbitmq-406-channel-closed-precondition-failed

你可能感兴趣的:(队列,Rabbitmq)