diff --git a/apps/devops/app/backend/infra/rabbitmq/async_client.py b/apps/devops/app/backend/infra/rabbitmq/async_client.py index a48fc58..39e9f28 100644 --- a/apps/devops/app/backend/infra/rabbitmq/async_client.py +++ b/apps/devops/app/backend/infra/rabbitmq/async_client.py @@ -37,8 +37,10 @@ class AsyncMQClient: name=self.exchange_name, type="direct", auto_delete=False ) + # Connect to existing named queue instead of creating anonymous queue + # channel_name already contains the full queue name from environment variable self.queue = await self.channel.declare_queue( - name=None, exclusive=True, auto_delete=True, durable=False + name=self.channel_name, exclusive=False, auto_delete=False, durable=True ) await self.queue.bind( exchange=self.exchange, routing_key=self.routing_key diff --git a/apps/devops/app/providers/common.py b/apps/devops/app/providers/common.py index 64a9a44..656bcc3 100644 --- a/apps/devops/app/providers/common.py +++ b/apps/devops/app/providers/common.py @@ -11,13 +11,13 @@ def register(app): # This hook ensures that a connection is opened to handle any queries # generated by the request. @app.on_event("startup") - def startup(): + async def startup(): pass # This hook ensures that the connection is closed when we've finished # processing the request. @app.on_event("shutdown") - def shutdown(): + async def shutdown(): pass