[trigger] Passage à l'auth via SSL
This commit is contained in:
parent
45ce52a405
commit
739411e857
6 changed files with 24 additions and 9 deletions
|
@ -23,7 +23,7 @@ class AsynchronousConsumer(object):
|
|||
|
||||
"""
|
||||
|
||||
def __init__(self, url, exchange_name, exchange_type):
|
||||
def __init__(self, url, exchange_name, exchange_type, port=5672, credentials=None, ssl=False):
|
||||
"""Create a new instance of the asynchronous consumer.
|
||||
|
||||
"""
|
||||
|
@ -35,6 +35,9 @@ class AsynchronousConsumer(object):
|
|||
self._exchange_name = exchange_name
|
||||
self._exchange_type = exchange_type
|
||||
self._url = url
|
||||
self._port = port
|
||||
self._credentials = credentials
|
||||
self._ssl = ssl
|
||||
|
||||
#+--------------------------------+
|
||||
#| Connection workers |
|
||||
|
@ -49,7 +52,7 @@ class AsynchronousConsumer(object):
|
|||
|
||||
"""
|
||||
logger.info("Opening connection to RabbitMQ AMQP host %s…", self._url)
|
||||
return pika.SelectConnection(pika.ConnectionParameters(self._url),
|
||||
return pika.SelectConnection(pika.ConnectionParameters(host=self._url, port=self._port, credentials=self._credentials, ssl=self._ssl),
|
||||
self.on_connection_open,
|
||||
stop_ioloop_on_close=False
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue