Skip to content

Commit edb7726

Browse files
committed
Add arguments to queue
1 parent 22b3f6a commit edb7726

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

message_queue/adapters/amqp_adapter.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def _consume_acknowledge(self, channel, tag, acknowledge=True):
171171

172172
channel.basic_ack(delivery_tag=tag)
173173

174-
def subscribe(self, exchange, queue, exchange_type="fanout"):
174+
def subscribe(self, exchange, queue, exchange_type="fanout", **kwargs):
175175
"""Subscribes to a exchange.
176176
177177
:param function worker: Method that consume the message
@@ -184,6 +184,13 @@ def subscribe(self, exchange, queue, exchange_type="fanout"):
184184
self.channel.exchange_declare(
185185
exchange=exchange, exchange_type=exchange_type)
186186

187-
self.channel.queue_declare(exclusive=True, queue=self.queue)
187+
self.channel.queue_declare(
188+
queue=self.queue,
189+
passive=kwargs.get('passive', False),
190+
durable=kwargs.get('durable', True),
191+
exclusive=kwargs.get('exclusive', False),
192+
auto_delete=kwargs.get('auto_delete', False),
193+
arguments=kwargs.get('arguments', None)
194+
)
188195

189196
self.channel.queue_bind(exchange=exchange, queue=self.queue)

0 commit comments

Comments
 (0)