def start_connection(self):
"""
reset the connection to rabbit mq
:return:
"""
logger = logging.getLogger(self.__class__.__name__)
logger.info("starting new rabbit mq connection")
# todo: do we need to make confirm_publish configurable?
self._conn = Connection(self.get_config().rabbitmq_url,
transport_options={'confirm_publish': True})
# setup producer to push to error and dlqs
self._producer = Producer(channel=self._conn.channel(),
exchange=self._orchestrator.get_exchange())
评论列表
文章目录