Skip to content
This repository was archived by the owner on Jan 10, 2026. It is now read-only.

Feature rabbitmq as message broker#27

Open
manudiv16 wants to merge 4 commits intoakhundMurad:mainfrom
manudiv16:feature/implement-rabbitmq-as-message-broker
Open

Feature rabbitmq as message broker#27
manudiv16 wants to merge 4 commits intoakhundMurad:mainfrom
manudiv16:feature/implement-rabbitmq-as-message-broker

Conversation

@manudiv16
Copy link

No description provided.

Copy link
Owner

@akhundMurad akhundMurad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing! 👍



class RabbitMQMessageBroker:
def __init__(self, client, *, routing_key: str | None = None, exchange: str | None = None) -> None:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please define the type of client argument


async def send_message(self, message: Message) -> None:
async with self._connection as connection:

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try to build a message here and the pass it to the basic_publish or publish

return RedisMessageBroker(client=redis_client, channel_prefix="test_diator_channel")

@pytest.fixture()
async def rabbitmq_client() -> aio_pika.Connection:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to use:
https://testcontainers-python.readthedocs.io/en/latest/rabbitmq/README.html - for RabbitMQ
https://testcontainers-python.readthedocs.io/en/latest/redis/README.html - for Redis

As a result, there will be no need for the docker-compose.

@akhundMurad akhundMurad added the enhancement New feature or request label Nov 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants