You is here : Home / rabbitmq pika Connection closed RABBITMQ Pika Connection ClosedbyLijiejie on September 20, 2016 | Browse 326 times
On the home PC, the port-scanned Python script appeared multiple times with Pika connection closed errors, and the same script was never a problem on the office and virtual machines.
It's strange, because I'm more cautious, using mq.conn.sleep () instead of time.sleep () in places where latency is required, and avoiding a long loop.
Connection closed is typically caused by a heartbeat timeout, and the server actively shuts down the connection.
To solve this problem, disable heartbeat on the PC at home, the parameter heartbeat_interval is set to 0:
1234 |
params = pika. Connectionparameters(host=mq_host, Port=mq_port, credentials=pikacredentials. Plaincredentialsmq_user mq_passwd) heartbeat_interval=0) self. Conn = pika. Blockingconnection(parameters=params) |
Posted in Python
Rabbitmq Pika Connection closed