[trigger] Passage à l'auth via SSL
This commit is contained in:
parent
45ce52a405
commit
739411e857
6 changed files with 24 additions and 9 deletions
|
@ -25,7 +25,7 @@ class BasicProducer(object):
|
|||
|
||||
"""
|
||||
|
||||
def __init__(self, url, exchange_name, app_id):
|
||||
def __init__(self, url, exchange_name, app_id, port=5672, credentials=None, ssl=False):
|
||||
"""Init
|
||||
|
||||
"""
|
||||
|
@ -35,6 +35,9 @@ class BasicProducer(object):
|
|||
self._exchange_name = exchange_name
|
||||
self._app_id = app_id
|
||||
self._url = url
|
||||
self._port = port
|
||||
self._credentials = credentials
|
||||
self._ssl = ssl
|
||||
logger.info("Initializing with app_id %s" % (self._app_id,))
|
||||
|
||||
def connect(self):
|
||||
|
@ -42,7 +45,7 @@ class BasicProducer(object):
|
|||
|
||||
"""
|
||||
logger.info("Connecting to %s…" % (self._url))
|
||||
return pika.BlockingConnection(pika.ConnectionParameters(self._url))
|
||||
return pika.BlockingConnection(pika.ConnectionParameters(host=self._url, port=self._port, credentials=self._credentials, ssl=self._ssl))
|
||||
|
||||
def get_chan(self):
|
||||
"""Creates a channel and reopens connection if needed."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue