From c487f7e75e40242c051bbaebb003f6f30b8101c4 Mon Sep 17 00:00:00 2001 From: Viktor Seifert Date: Tue, 12 Jul 2022 15:12:29 +0200 Subject: [PATCH] RED-4564: Added logging messages to better track message-queue events --- pyinfra/queue/queue_manager/pika_queue_manager.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pyinfra/queue/queue_manager/pika_queue_manager.py b/pyinfra/queue/queue_manager/pika_queue_manager.py index ad5191a..ad1ecfa 100644 --- a/pyinfra/queue/queue_manager/pika_queue_manager.py +++ b/pyinfra/queue/queue_manager/pika_queue_manager.py @@ -147,10 +147,15 @@ class PikaQueueManager(QueueManager): try: consumer_tag = self.channel.basic_consume(self._input_queue, callback) + logger.info(f"Connected to message-queue with consumer-tag|{consumer_tag}") + self.channel.start_consuming() finally: if consumer_tag: + logger.info(f"Cancelling subscription for consumer-tag|{consumer_tag}") self.channel.basic_cancel(consumer_tag) + else: + logger.info(f"Aborting listening on queue before a consumer-tag was received") def clear(self): try: