add heartbeat to AMQP connection

This commit is contained in:
Julius Unverfehrt 2022-03-22 15:39:39 +01:00
parent 004c5fa805
commit 7488394e31

View File

@ -45,7 +45,7 @@ def get_connection():
credentials = pika.PlainCredentials(username=CONFIG.rabbitmq.user, password=CONFIG.rabbitmq.password)
kwargs = {"host": CONFIG.rabbitmq.host, "port": CONFIG.rabbitmq.port, "credentials": credentials}
kwargs = {"host": CONFIG.rabbitmq.host, "port": CONFIG.rabbitmq.port, "credentials": credentials, "heartbeat": CONFIG.rabbitmq.heartbeat}
parameters = pika.ConnectionParameters(**kwargs)
@ -96,7 +96,7 @@ class PikaQueueManager(QueueManager):
def publish_response(self, message, callback, max_attempts=3):
logger.debug(f"Publishing response for {message}.")
logger.debug(f"Processing {message}.")
frame, properties, body = message