diff --git a/CHANGELOG.md b/CHANGELOG.md index c5eebf4..58ad902 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [5.1.7] - 2024-08-20 +- added more logs for RabbitMQ connection +- rollback `pika` to fix breaking changes + ## [5.1.6] - 2024-08-19 - remove usage of `accN` index for Tenants model. Proxy old methods and attributes to `acc` index diff --git a/modular_sdk/connections/rabbit_connection.py b/modular_sdk/connections/rabbit_connection.py index 00a3f11..bea9802 100644 --- a/modular_sdk/connections/rabbit_connection.py +++ b/modular_sdk/connections/rabbit_connection.py @@ -32,6 +32,7 @@ def _close(self): def publish(self, message, routing_key, exchange='', headers=None, content_type=None): + _LOG.debug(f'Request queue: {routing_key}') channel = self._open_channel() channel.confirm_delivery() response = channel.basic_publish( @@ -43,16 +44,19 @@ def publish(self, message, routing_key, exchange='', headers=None, mandatory=True) self._close() if not response: - message = ('Message was returned. Check RabbitMQ ' - 'configuration: maybe target queue does not exists.') - _LOG.error(message) - raise ModularException(code=504, content=message) + _LOG.error(f'Message was not sent: routing_key={routing_key}, ' + f'exchange={exchange}, content_type={content_type}') + raise ModularException( + code=504, + content='Message was not sent. Check RabbitMQ configuration' + ) _LOG.info('Message pushed') def publish_sync(self, message, routing_key, correlation_id, callback_queue, exchange='', headers=None, content_type=None): - + _LOG.debug(f'Request queue: {routing_key}; ' + f'Response queue: {callback_queue}') channel = self._open_channel() channel.confirm_delivery() response = channel.basic_publish( @@ -64,10 +68,14 @@ def publish_sync(self, message, routing_key, correlation_id, content_type=content_type), body=message) if not response: - message = ('Message was returned. Check RabbitMQ ' - 'configuration: maybe target queue does not exists.') - _LOG.error(message) - raise ModularException(code=504, content=message) + _LOG.error(f'Message was not sent: routing_key={routing_key}, ' + f'correlation_id={correlation_id}, ' + f'callback_queue={callback_queue}, ' + f'exchange={exchange}, content_type={content_type}') + raise ModularException( + code=504, + content='Message was not sent. Check RabbitMQ configuration' + ) _LOG.info('Message pushed') def consume_sync(self, queue, correlation_id): diff --git a/pyproject.toml b/pyproject.toml index a28ed39..6e7b0b1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta" [project] name = "modular_sdk" -version = "5.1.6" +version = "5.1.7" authors = [ {name = "EPAM Systems", email = "support@syndicate.team"} ] @@ -19,7 +19,7 @@ classifiers = [ "Operating System :: OS Independent" ] dependencies = [ - "pika>=1.3.2,<2.0", + "pika==1.0.0b1", "pynamodb>=5.5.1,<6", "boto3>=1.26.80,<1.35", "botocore>=1.29.80,<1.35", diff --git a/requirements.txt b/requirements.txt index 4387934..0e6f9b7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,15 +1,10 @@ pika==1.0.0b1 -pynamodb==5.3.2 -boto3==1.26.80 -botocore==1.29.80 -dynamodb-json==1.3 -pymongo==4.5.0 -python-dateutil==2.8.2 -simplejson==3.19.1 -six==1.16.0 -urllib3==1.26.16 -aws-xray-sdk==2.12.0 -pycparser==2.21 -cffi==1.15.1 -cryptography==41.0.3 -cachetools==5.3.1 \ No newline at end of file +pynamodb>=5.5.1,<6 +boto3>=1.26.80,<1.35 +botocore>=1.29.80,<1.35 +pymongo~=4.5.0 +python-dateutil>=2.8.2,<3.0 +cachetools~=5.4.0 +dynamodb-json~=1.4.2 +aws-xray-sdk~=2.14.0 +cryptography~=41.0.7 \ No newline at end of file