예제 #1
0
    def __init__(self, subscribers, publishers, mqtt_routing_key):

        super(MQTTConverterSink, self).__init__(subscribers, publishers)
        _LOGGER.debug("Subscribers: %s" % self.subscribers)
        _LOGGER.debug("Publishers: %s" % self.publishers)

        self.routing_key = mqtt_routing_key

        self.exchange = 'amq.topic'  # Default MQTT topic with RabbitMQ
        self.config = get_config()
예제 #2
0
    def __init__(self, subscribers, publishers, mqtt_routing_key):

        super(MQTTConverterSink, self).__init__(subscribers, publishers)
        _LOGGER.debug("Subscribers: %s" % self.subscribers)
        _LOGGER.debug("Publishers: %s" % self.publishers)

        self.routing_key = mqtt_routing_key

        self.exchange = 'amq.topic'  # Default MQTT topic with RabbitMQ
        self.config = get_config()
예제 #3
0
    def __init__(self, base_routing_key, rabbitmq_user, rabbitmq_pwd):

        super(PikaSubscriber, self).__init__(base_routing_key)
        _LOGGER.debug("Base routing key: %s" % self.base_routing_key)
        _LOGGER.debug("Routing keys: %s" % self.routing_keys)
        _LOGGER.debug("Metric buffers: %s" % self.metric_buffers)

        self.rabbitmq_user = rabbitmq_user
        self.rabbitmq_pwd = rabbitmq_pwd

        self.connection = None
        self.channels = {}
        self.config = get_config()
        self.rabbitmq_address = self.config['rabbitHost']
        self.auth = CloudbrainAuth(self.config['authUrl'])
        self.rabbitmq_vhost = self.auth.get_vhost(rabbitmq_user, rabbitmq_pwd)
예제 #4
0
    def __init__(self, base_routing_key, rabbitmq_address, rabbitmq_user,
                 rabbitmq_pwd, rabbitmq_vhost):

        super(PikaPublisher, self).__init__(base_routing_key)
        _LOGGER.debug("Base routing key: %s" % self.base_routing_key)
        _LOGGER.debug("Routing keys: %s" % self.routing_keys)
        _LOGGER.debug("Metric buffers: %s" % self.metric_buffers)

        self.config = get_config()
        self.rabbitmq_address = rabbitmq_address
        self.rabbitmq_user = rabbitmq_user
        self.rabbitmq_pwd = rabbitmq_pwd
        self.rabbitmq_vhost = rabbitmq_vhost
        if self.rabbitmq_address == self.config['rabbitHost']:
            self._override_vhost()
        self.connection = None
        self.channels = {}
예제 #5
0
    def __init__(self,
                 base_routing_key,
                 rabbitmq_user,
                 rabbitmq_pwd):

        super(PikaPublisher, self).__init__(base_routing_key)
        _LOGGER.debug("Base routing key: %s" % self.base_routing_key)
        _LOGGER.debug("Routing keys: %s" % self.routing_keys)
        _LOGGER.debug("Metric buffers: %s" % self.metric_buffers)

        self.rabbitmq_user = rabbitmq_user
        self.rabbitmq_pwd = rabbitmq_pwd

        self.connection = None
        self.channels = {}
        self.config = get_config()
        self.rabbitmq_address = self.config['rabbitHost']
        self.auth = CloudbrainAuth(self.config['authUrl'])
        self.rabbitmq_vhost = self.auth.get_vhost(rabbitmq_user, rabbitmq_pwd)
예제 #6
0
    def __init__(self,
                 base_routing_key,
                 rabbitmq_address,
                 rabbitmq_user,
                 rabbitmq_pwd,
                 rabbitmq_vhost):

        super(PikaPublisher, self).__init__(base_routing_key)
        _LOGGER.debug("Base routing key: %s" % self.base_routing_key)
        _LOGGER.debug("Routing keys: %s" % self.routing_keys)
        _LOGGER.debug("Metric buffers: %s" % self.metric_buffers)

        self.config = get_config()
        self.rabbitmq_address = rabbitmq_address
        self.rabbitmq_user = rabbitmq_user
        self.rabbitmq_pwd = rabbitmq_pwd
        self.rabbitmq_vhost = rabbitmq_vhost
        if self.rabbitmq_address == self.config['rabbitHost']:
            self._override_vhost()
        self.connection = None
        self.channels = {}
예제 #7
0
    def __init__(self,
                 subscribers,
                 publishers,
                 mqtt_routing_key,
                 username,
                 password):

        super(MQTTConverterSource, self).__init__(subscribers, publishers)
        _LOGGER.debug("Subscribers: %s" % self.subscribers)
        _LOGGER.debug("Publishers: %s" % self.publishers)

        self.threads = []
        self.mqtt_routing_key = mqtt_routing_key
        self.username = username
        self.password = password
        self.exchange = 'amq.topic'
        vhost = _get_vhost(username, password)
        host = get_config()['rabbitHost']
        self.queue_name = 'MQTTConverterSource-' + str(uuid4())
        self.mqtt_channel = _setup_mqtt_channel(username, password, host, vhost,
                                                self.exchange, mqtt_routing_key,
                                                self.queue_name)
예제 #8
0
def _get_vhost(username, password):
    config = get_config()
    auth = CloudbrainAuth(config['authUrl'])
    return auth.get_vhost(username, password)
예제 #9
0
def _get_vhost(username, password):
    config = get_config()
    auth = CloudbrainAuth(config['authUrl'])
    return auth.get_vhost(username, password)