From 42701b356231a773982bc4ae7f38c169dcd6c1c3 Mon Sep 17 00:00:00 2001 From: "michael.rabellino" Date: Thu, 20 Jun 2024 13:12:24 -0600 Subject: [PATCH] debug logging in publish_confirm to track down an RP issue --- python/idsse_common/idsse/common/publish_confirm.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/python/idsse_common/idsse/common/publish_confirm.py b/python/idsse_common/idsse/common/publish_confirm.py index ea4dc64..bdcf97a 100644 --- a/python/idsse_common/idsse/common/publish_confirm.py +++ b/python/idsse_common/idsse/common/publish_confirm.py @@ -110,7 +110,9 @@ def publish_message(self, Raises: RuntimeError: if channel is uninitialized (start() not completed yet) or is closed """ + logger.info('DEBUG: in publish_message, waiting for channel to be ready...') self._wait_for_channel_to_be_ready() + logger.info('DEBUG: channel is ready to publish message') # We expect a JSON message format, do a check here... try: @@ -125,7 +127,7 @@ def publish_message(self, properties) self._records.message_number += 1 self._records.deliveries[self._records.message_number] = message - logger.debug('Published message # %i to exchange %s, queue %s, routing_key %s', + logger.info('Published message # %i to exchange %s, queue %s, routing_key %s', self._records.message_number, self._rmq_params.exchange.name, self._rmq_params.queue.name, routing_key) return True @@ -207,16 +209,17 @@ def _wait_for_channel_to_be_ready(self) -> None: RabbitMQ setup. This method will not return until channel is confirmed ready for use""" # validate that PublishConfirm thread has been set up and connected to RabbitMQ + logger.info('DEBUG: in _wait_for_channel_to_be_ready') if not (self._connection and self._connection.is_open and self._channel and self._channel.is_open): - logger.debug('Channel is not ready to publish, calling _start() now') + logger.info('Channel is not ready to publish, calling _start() now') # pass callback to flip is_ready flag, and block until flag changes is_ready = Event() self._start(callback=is_ready.set) is_ready.wait() - logger.debug('Connection and channel setup complete, ready to publish message') + logger.info('Connection and channel setup complete, ready to publish message') def _on_connection_open(self, connection: SelectConnection): """This method is called by pika once the connection to RabbitMQ has been established.