diff --git a/neon_mq_connector/consumers/select_consumer.py b/neon_mq_connector/consumers/select_consumer.py index 22e4335..238f990 100644 --- a/neon_mq_connector/consumers/select_consumer.py +++ b/neon_mq_connector/consumers/select_consumer.py @@ -82,7 +82,7 @@ def __init__(self, self._loop = get_event_loop() self.__stop_loop_on_exit = False except RuntimeError as e: - LOG.info(e) + LOG.info(f"Creating a new event loop: e={e}") self._loop = new_event_loop() set_event_loop(self._loop) self._loop.run_forever() diff --git a/neon_mq_connector/utils/client_utils.py b/neon_mq_connector/utils/client_utils.py index 2c8c175..8676f44 100644 --- a/neon_mq_connector/utils/client_utils.py +++ b/neon_mq_connector/utils/client_utils.py @@ -50,6 +50,14 @@ class NeonMQHandler(MQConnector): + """ + This class is intended for use with `send_mq_request` for simple, + transactional reqeusts. Applications needing a persistent connection to + MQ services should implement `MQConnector` directly. + """ + + async_consumers_enabled = False + def __init__(self, config: dict, service_name: str, vhost: str): super().__init__(config, service_name) self.vhost = vhost diff --git a/tests/test_utils.py b/tests/test_utils.py index 6c55e40..49ce27d 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -35,8 +35,7 @@ import pytest import pika -from threading import Thread - +from threading import Thread, Event sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..")) @@ -137,7 +136,7 @@ def setUp(self) -> None: @classmethod def tearDownClass(cls) -> None: if cls.test_connector is not None: - cls.test_connector.stop_consumers() + cls.test_connector.stop() def test_send_mq_request_valid(self): from neon_mq_connector.utils.client_utils import send_mq_request @@ -190,7 +189,8 @@ def check_response(name: str): for p in processes: p.join(60) - self.assertEqual(len(processes), len(responses)) + self.assertEqual(len(processes), len(responses), + f"len(responses)={len(responses)}") for resp in responses.values(): self.assertTrue(resp['success'], resp.get('reason'))