feat(notification): add rabbitmq credentials relates notification services configs

Signed-off-by: zhenyus <zhenyus@mathmast.com>
This commit is contained in:
zhenyus 2025-02-24 02:05:25 +08:00
parent da584b8ffa
commit 853d817933
2 changed files with 7 additions and 1 deletions

View File

@ -25,7 +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,
password=app_settings.RABBITMQ_PASSWORD,
virtualhost=app_settings.RABBITMQ_VIRTUAL_HOST),
loop=event_loop, loop=event_loop,
) )
self.channel = await self.connection.channel() self.channel = await self.connection.channel()

View File

@ -8,6 +8,9 @@ class AppSettings(BaseSettings):
RABBITMQ_HOST: str = "" RABBITMQ_HOST: str = ""
RABBITMQ_PORT: int = 5672 RABBITMQ_PORT: int = 5672
RABBITMQ_USERNAME: str = ""
RABBITMQ_PASSWORD: str = ""
RABBITMQ_VIRTUAL_HOST: str = ""
SYSTEM_USER_ID: str = "" SYSTEM_USER_ID: str = ""
SMS_FROM: str = "" SMS_FROM: str = ""