From 67b448f787670d7454874e296017463067fe7b70 Mon Sep 17 00:00:00 2001 From: pepellsd Date: Sun, 22 Dec 2024 00:52:39 +0300 Subject: [PATCH] add default for queue type --- faststream/rabbit/broker/broker.py | 3 +-- faststream/rabbit/schemas/__init__.py | 4 +--- faststream/rabbit/schemas/queue.py | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/faststream/rabbit/broker/broker.py b/faststream/rabbit/broker/broker.py index 393dbfd1e7..2e650372d2 100644 --- a/faststream/rabbit/broker/broker.py +++ b/faststream/rabbit/broker/broker.py @@ -27,7 +27,6 @@ RABBIT_REPLY, RabbitExchange, RabbitQueue, - RabbitQueueType, ) from faststream.rabbit.security import parse_security from faststream.rabbit.subscriber.asyncapi import AsyncAPISubscriber @@ -476,7 +475,7 @@ async def _connect( # type: ignore[override] if max_consumers: c = AsyncAPISubscriber.build_log_context( None, - RabbitQueue("", queue_type=RabbitQueueType.Classic), + RabbitQueue(""), RabbitExchange(""), ) self._log(f"Set max consumers to {max_consumers}", extra=c) diff --git a/faststream/rabbit/schemas/__init__.py b/faststream/rabbit/schemas/__init__.py index 57fdb923ab..e4db738fc4 100644 --- a/faststream/rabbit/schemas/__init__.py +++ b/faststream/rabbit/schemas/__init__.py @@ -14,6 +14,4 @@ "ReplyConfig", ) -RABBIT_REPLY = RabbitQueue( - "amq.rabbitmq.reply-to", passive=True, queue_type=RabbitQueueType.Classic -) +RABBIT_REPLY = RabbitQueue("amq.rabbitmq.reply-to", passive=True) diff --git a/faststream/rabbit/schemas/queue.py b/faststream/rabbit/schemas/queue.py index 86aca7d35e..5e215908a1 100644 --- a/faststream/rabbit/schemas/queue.py +++ b/faststream/rabbit/schemas/queue.py @@ -131,7 +131,7 @@ def routing(self) -> str: def __init__( self, name: str, - queue_type: Literal[RabbitQueueType.Classic], + queue_type: Literal[RabbitQueueType.Classic] = RabbitQueueType.Classic, durable: Literal[True, False] = False, exclusive: bool = False, passive: bool = False,