SimpleQueue: allow override of exchange_type

This commit is contained in:
Vince Gonzalez 2013-09-09 11:46:55 -04:00 committed by Ask Solem
parent 77b075d6c9
commit 3f0a387aa6
1 changed files with 2 additions and 2 deletions

View File

@ -101,7 +101,7 @@ class SimpleBase(object):
class SimpleQueue(SimpleBase):
no_ack = False
queue_opts = {}
exchange_opts = {}
exchange_opts = { 'type': 'direct' }
def __init__(self, channel, name, no_ack=None, queue_opts=None,
exchange_opts=None, serializer=None,
@ -112,7 +112,7 @@ class SimpleQueue(SimpleBase):
if no_ack is None:
no_ack = self.no_ack
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)
else:
name = queue.name