All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.atleon.kafka.embedded.EmbeddedKafkaConfig Maven / Gradle / Ivy

The newest version!
package io.atleon.kafka.embedded;

import kafka.server.KafkaConfig;

import java.util.Map;
import java.util.Objects;

public class EmbeddedKafkaConfig {

    private final Map kafkaConfigValues;

    private EmbeddedKafkaConfig(Map kafkaConfigValues) {
        this.kafkaConfigValues = kafkaConfigValues;
    }

    static EmbeddedKafkaConfig fromKafkaConfig(KafkaConfig kafkaConfig) {
        return new EmbeddedKafkaConfig(kafkaConfig.values());
    }

    public String getSecureConnect() {
        return getSecurityProtocol() + "://" + getConnect();
    }

    public String getSecurityProtocol() {
        return Objects.toString(kafkaConfigValues.get(KafkaConfig.InterBrokerSecurityProtocolProp()));
    }

    public String getConnect() {
        return Objects.toString(kafkaConfigValues.get(KafkaConfig.ListenersProp()));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy