def __init__(self, config, name): StreamIntegration.__init__(self, config, name) integration_info = self.config['integrations'][self.name] self.connection_info = integration_info.get('connection') self.advanced_info = integration_info.get('advanced', {}) self.advanced_common = self.advanced_info.get('common', {}) self.connection_params = {} self.connection_params.update(self.connection_info) self.connection_params.update(self.advanced_common) self.control_topic_name = integration_info.get('topic', None) self.client = self._get_connection()
def __init__(self, config, name): StreamIntegration.__init__(self, config, name) integration_info = self.config['integrations'][self.name] self.connection_info = integration_info.get("connection", {}) self.advanced_info = integration_info.get("advanced", {}) self.connection_params = {} self.connection_params.update(self.connection_info) self.connection_params.update(self.advanced_info) self.client = self._get_connection() self.control_stream_name = integration_info.get('stream') self.control_stream = self.client.Stream(self.control_stream_name)
def __init__(self, config, name, db_info): self.connection_info = db_info['connection'] # Back compatibility with initial API version self.control_stream = db_info.get('control_stream') or db_info.get( 'stream') or None if 'advanced' in db_info: self.connection_info['advanced'] = db_info['advanced'] StreamIntegration.__init__( self, config, name, control_stream=RedisStream(self.control_stream, self.connection_info) if self.control_stream else None)
def __init__(self, config, name, db_info): self.connection_info = db_info['connection'] # Back compatibility with initial API version self.control_stream = db_info.get('control_stream') or db_info.get( 'topic') or None if 'advanced' in db_info: self.connection_info['advanced'] = db_info['advanced'] self.control_connection_info = deepcopy(self.connection_info) # don't need to read all records from the beginning of 'control stream' # since all active streams are saved in db. Use 'latest' auto_offset_reset for control stream if 'advanced' in self.control_connection_info: if 'consumer' in self.control_connection_info['advanced']: self.control_connection_info['advanced']['consumer'][ 'auto_offset_reset'] = 'latest' StreamIntegration.__init__( self, config, name, control_stream=KafkaStream(self.control_stream, self.control_connection_info) if self.control_stream else None)