io.openlineage.client.transports.KafkaTransportBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of openlineage-java Show documentation
Show all versions of openlineage-java Show documentation
Java library for OpenLineage
/*
/* Copyright 2018-2024 contributors to the OpenLineage project
/* SPDX-License-Identifier: Apache-2.0
*/
package io.openlineage.client.transports;
public class KafkaTransportBuilder implements TransportBuilder {
private static final String DEFAULT_LINEAGE_SOURCE = "openlineage-java";
@Override
public TransportConfig getConfig() {
return new KafkaConfig();
}
@Override
public Transport build(TransportConfig config) {
final KafkaConfig kafkaConfig = (KafkaConfig) config;
if (!kafkaConfig.hasLocalServerId()) {
// Set the local server ID to the lineage source when not specified
kafkaConfig.setLocalServerId(DEFAULT_LINEAGE_SOURCE);
}
kafkaConfig.getProperties().put("server.id", kafkaConfig.getLocalServerId());
return new KafkaTransport(kafkaConfig);
}
@Override
public String getType() {
return "kafka";
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy