(self, config=None)
Create a new instance of rmqHandler class
Create a new instance of rmqHandler class
Create a new instance of rmqHandler class
def __init__(self, config=None):
        """
          Create a new instance of rmqHandler class
        """

        # Initialize Handler
        Handler.__init__(self, config)

        if pika is None:
            self.log.error('pika import failed. Handler disabled')
            self.enabled = False
            return

        # Initialize Data
        self.connections = {}
        self.channels = {}
        self.reconnect_interval = 1

        # Initialize Options
        tmp_rmq_server = self.config['rmq_server']
        if type(tmp_rmq_server) is list:
            self.rmq_server = tmp_rmq_server
        else:
            self.rmq_server = [tmp_rmq_server]

        self.rmq_port = 5672
        self.rmq_exchange = self.config['rmq_exchange']
        self.rmq_user = None
        self.rmq_password = None
        self.rmq_vhost = '/'
        self.rmq_exchange_type = 'fanout'
        self.rmq_durable = True
        self.rmq_heartbeat_interval = 300

        self.get_config()
        # Create rabbitMQ pub socket and bind
        try:
            self._bind_all()
        except pika.exceptions.AMQPConnectionError:
            self.log.error('Failed to bind to rabbitMQ pub socket')
def __init__ ( self , config = None ) : # Initialize Handler Handler . __init__ ( self , config ) if pika is None : self . log . error ( 'pika import failed. Handler disabled' ) self . enabled = False return # Initialize Data self . connections = { } self . channels = { } self . reconnect_interval = 1 # Initialize Options tmp_rmq_server = self . config [ 'rmq_server' ] if type ( tmp_rmq_server ) is list : self . rmq_server = tmp_rmq_server else : self . rmq_server = [ tmp_rmq_server ] self . rmq_port = 5672 self . rmq_exchange = self . config [ 'rmq_exchange' ] self . rmq_user = None self . rmq_password = None self . rmq_vhost = '/' self . rmq_exchange_type = 'fanout' self . rmq_durable = True self . rmq_heartbeat_interval = 300 self . get_config ( ) # Create rabbitMQ pub socket and bind try : self . _bind_all ( ) except pika . exceptions . AMQPConnectionError : self . log . error ( 'Failed to bind to rabbitMQ pub socket' )