[Python] Pika BlockingConnection & RabbitMQ : connection closed

Discussão em 'Python' iniciado por Stack, Abril 26, 2025.

  1. Stack

    Stack Membro Participativo

    I have 2 rabbitmq in cluster load balanced by an Azure Internal Load Balancer. The client connect to the LB with BlockingConnection.

    When there a are message exchanged by the clients, everything works fine. But when there is no activity, it seems my clients are disconnected and and not able to receive messages anymore.

    I am wondering if there is a solution to this problem ? I assume the load balancer or rabbitmq is closing the connection due to inactivity. I wanted to let pika trigger some heartbeat to rabbitmq (so that the load balancer keep the connection opened) but didn't find any good solution. Could you advice ?

    EDIT 1 It seems pika BlockingConnections does not support heartbeat. Heart beat disables blocking connection

    Thank you.

    Continue reading...

Compartilhe esta Página