mirror of https://github.com/celery/kombu.git
SimpleQueue: allow override of exchange_type
This commit is contained in:
parent
77b075d6c9
commit
3f0a387aa6
|
@ -101,7 +101,7 @@ class SimpleBase(object):
|
||||||
class SimpleQueue(SimpleBase):
|
class SimpleQueue(SimpleBase):
|
||||||
no_ack = False
|
no_ack = False
|
||||||
queue_opts = {}
|
queue_opts = {}
|
||||||
exchange_opts = {}
|
exchange_opts = { 'type': 'direct' }
|
||||||
|
|
||||||
def __init__(self, channel, name, no_ack=None, queue_opts=None,
|
def __init__(self, channel, name, no_ack=None, queue_opts=None,
|
||||||
exchange_opts=None, serializer=None,
|
exchange_opts=None, serializer=None,
|
||||||
|
@ -112,7 +112,7 @@ class SimpleQueue(SimpleBase):
|
||||||
if no_ack is None:
|
if no_ack is None:
|
||||||
no_ack = self.no_ack
|
no_ack = self.no_ack
|
||||||
if not isinstance(queue, entity.Queue):
|
if not isinstance(queue, entity.Queue):
|
||||||
exchange = entity.Exchange(name, 'direct', **exchange_opts)
|
exchange = entity.Exchange(name, **exchange_opts)
|
||||||
queue = entity.Queue(name, exchange, name, **queue_opts)
|
queue = entity.Queue(name, exchange, name, **queue_opts)
|
||||||
else:
|
else:
|
||||||
name = queue.name
|
name = queue.name
|
||||||
|
|
Loading…
Reference in New Issue