pika.exceptions.ChannelClosed: (406, "PRECONDITION_FAILED - parameters for queue

原创 赤水  2016年5月3日 07:06 阅读 824 次

RabbitMq 在使用时因为生产者和消费者属性不一致导致报错如下:

Traceback (most recent call last):
  File "/data/python/test/Mq.py", line 22, in <module>
    RabbitMqReceDurable('wgl')
  File "/data/python/test/Mq.py", line 9, in RabbitMqReceDurable
    ClientReq.queue_declare(queue=RabbitName)
  File "/usr/local/lib/python2.7/dist-packages/pika/adapters/blocking_connection.py", line 2329, in queue_declare
    self._flush_output(declare_ok_result.is_ready)
  File "/usr/local/lib/python2.7/dist-packages/pika/adapters/blocking_connection.py", line 1181, in _flush_output
    raise exceptions.ChannelClosed(method.reply_code, method.reply_text)
pika.exceptions.ChannelClosed: (406, "PRECONDITION_FAILED - parameters for queue 'wgl' in vhost '/' not equivalent")

 

解决方法:

  1. 修改名字
  2. 修改生产者或消费者属性,保持其一致!

 

 

本文地址: http://blog.lssin.com/readblog/104.html
版权声明:本文为原创文章,版权归  赤水 所有,欢迎分享本文,转载请保留出处!

发表评论


表情