Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/307.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 皮卡频道在一段时间后停止消费_Python_Rabbitmq_Pika - Fatal编程技术网

Python 皮卡频道在一段时间后停止消费

Python 皮卡频道在一段时间后停止消费,python,rabbitmq,pika,Python,Rabbitmq,Pika,我有一个Pika频道在RabbitMQ队列上侦听: credentials = pika.PlainCredentials(user, passwd) connection = pika.BlockingConnection( pika.ConnectionParameters(host=host, port=port, credentials=

我有一个Pika频道在RabbitMQ队列上侦听:

credentials = pika.PlainCredentials(user, passwd)
connection = pika.BlockingConnection(
        pika.ConnectionParameters(host=host,
                                  port=port,
                                  credentials=credentials,
                                  heartbeat=0))
channel = connection.channel()

channel.basic_consume(on_message_callback=callbackFun,
                      queue=queue,
                      auto_ack=True)

channel.start_consuming()
任何东西都会在一段时间内保持良好状态,直到不知什么原因停止消费。 重新启动pod解决了这个问题,所以我似乎找不到超时问题(注意心跳被禁用)


如何避免这种行为?

添加更多信息callbackFun实际上做什么?停止后,连接状态如何?关门了?有错误吗?可能尝试访问连接的私有变量\u错误RabbitMQ记录了什么?