Commit e69abb41 authored by Matteo Filipponi's avatar Matteo Filipponi

Modify AmqpListener init

parent 8c1217f5
Pipeline #2364 passed with stage
in 0 seconds
......@@ -24,17 +24,18 @@ class AmqpListener(threading.Thread):
DEFAULT_EXCHAGE = 'amq.topic'
DEFAULT_AMQP_URL = 'amqp://guest:guest@locahost/'
def __init__(self, amqp_url, amqp_exchange, callback, topics=None, use_message_typing=True, queue_name=None):
def __init__(self, amqp_url, amqp_exchange, callback, topics=None, use_message_typing=True, pre_declared_queue=None):
self.COMPONENT_ID = 'amqp_listener_%s' % str(uuid.uuid4())[:8]
self.connection = None
self.channel = None
self.services_queue_name = 'services_queue@%s' % self.COMPONENT_ID
self.queue_is_declared = False
if queue_name:
self.services_queue_name = queue_name
if pre_declared_queue:
self.services_queue_name = pre_declared_queue
self.queue_is_declared = True
else:
self.services_queue_name = 'services_queue@%s' % self.COMPONENT_ID
self.queue_is_declared = False
self.use_message_typing = use_message_typing
threading.Thread.__init__(self)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment