Example #1
0
def generate_config(config):
    topologies = {"topologies": []}
    env = template_engine_instance()
    template = env.get_template("streaming_producer.json.j2")
    for service in config.DataBrokerConfiguration.publishedServices:
        for entity in service.entities:
            renderedTemplate = template.render(entity=entity)
            renderedTemplateAsJson = json.loads(renderedTemplate)
            topologies["topologies"].append(renderedTemplateAsJson)

    return json.dumps(topologies)
Example #2
0
def generate_config(config):
    env = template_engine_instance()
    template = env.get_template("azkarra.conf")
    azkarra_component_paths = (OmegaConf.select(
        config, "azkarra.component.paths") or None)
    azkarra_home = OmegaConf.select(config, "azkarra.home") or None
    broker_password = OmegaConf.select(config, "broker.password") or None
    broker_username = OmegaConf.select(config, "broker.username") or None
    return template.render(
        config,
        azkarra_component_paths=azkarra_component_paths,
        azkarra_home=azkarra_home,
        broker_password=broker_password,
        broker_username=broker_username,
    )
Example #3
0
 def generate_config(self):
     env = template_engine_instance()
     template = env.get_template("debezium/postgres.json")
     parsed_whitelist = self.__parse_whitelist(
         self.config.DataBrokerConfiguration.publishedServices[0].entities)
     database_data = self.config.DatabaseHost.split(":")
     database_hostname = database_data[0]
     if len(database_data) > 1:
         # custom port provided
         database_port = database_data[1]
     else:
         # use default port
         database_port = POSTGRESQL_DEFAULT_PORT
     return template.render(
         self.config,
         parsed_whitelist=parsed_whitelist,
         database_hostname=database_hostname,
         database_port=database_port,
     )
Example #4
0
def generate_config(config):
    env = template_engine_instance()
    template = env.get_template("kafka-connect.properties.j2")
    return template.render(config)
Example #5
0
def generate_kafka_connect_jmx_config():
    env = template_engine_instance()
    template = env.get_template("jmx/kafka-connect.yaml.j2")
    return template.render(java_path=JAVA_BIN_PATH)
Example #6
0
def generate_config(config):
    env = template_engine_instance()
    template = env.get_template("streaming_producer.json")
    return template.render(config)
Example #7
0
def generate_kafka_connect_logging_config(config):
    env = template_engine_instance()
    template = env.get_template("logging/debezium-log4j.properties")
    return template.render(config)