fix(rabbitmq): correct syntax for port and virtual host parameters in AsyncMQClient

Signed-off-by: zhenyus <zhenyus@mathmast.com>
This commit is contained in:
zhenyus 2025-02-24 02:20:01 +08:00
parent 853d817933
commit 78c72179ec

View File

@ -25,10 +25,10 @@ class AsyncMQClient:
try: try:
self.connection = await aio_pika.connect_robust( self.connection = await aio_pika.connect_robust(
host=app_settings.RABBITMQ_HOST, host=app_settings.RABBITMQ_HOST,
port=int(app_settings.RABBITMQ_PORT, port=int(app_settings.RABBITMQ_PORT),
login=app_settings.RABBITMQ_USERNAME, login=app_settings.RABBITMQ_USERNAME,
password=app_settings.RABBITMQ_PASSWORD, password=app_settings.RABBITMQ_PASSWORD,
virtualhost=app_settings.RABBITMQ_VIRTUAL_HOST), virtualhost=app_settings.RABBITMQ_VIRTUAL_HOST,
loop=event_loop, loop=event_loop,
) )
self.channel = await self.connection.channel() self.channel = await self.connection.channel()