

def __init__(self, config=None):
    '\n          Create a new instance of rmqHandler class\n        '
    Handler.__init__(self, config)
    self.connection = None
    self.channel = None
    self.server = self.config.get('server', '127.0.0.1')
    self.port = int(self.config.get('port', 5672))
    self.topic_exchange = self.config.get('topic_exchange', 'diamond')
    self.vhost = self.config.get('vhost', '')
    self.user = self.config.get('user', 'guest')
    self.password = self.config.get('password', 'guest')
    self.routing_key = self.config.get('routing_key', 'metric')
    self.custom_routing_key = self.config.get('custom_routing_key', 'diamond')
    if (not pika):
        self.log.error('pika import failed. Handler disabled')
        self.enabled = False
        return
    try:
        self._bind()
    except pika.exceptions.AMQPConnectionError:
        self.log.error('Failed to bind to rabbitMQ topic exchange')

dataset/ETHPy150Open BrightcoveOS/Diamond/src/diamond/handler/rabbitmq_topic.py rmqHandler.__init__/original