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

io.quarkus.kafka.client.runtime.KafkaRecorder Maven / Gradle / Ivy

There is a newer version: 3.17.5
Show newest version
package io.quarkus.kafka.client.runtime;

import java.util.Optional;

import org.eclipse.microprofile.config.Config;
import org.eclipse.microprofile.config.ConfigProvider;

import io.quarkus.runtime.annotations.Recorder;

@Recorder
public class KafkaRecorder {

    public void checkBoostrapServers() {
        Config config = ConfigProvider.getConfig();
        Boolean serviceBindingEnabled = config.getValue("quarkus.kubernetes-service-binding.enabled", Boolean.class);
        if (!serviceBindingEnabled) {
            return;
        }
        Optional boostrapServersOptional = config.getOptionalValue("kafka.bootstrap.servers", String.class);
        if (boostrapServersOptional.isEmpty()) {
            throw new IllegalStateException(
                    "The property 'kafka.bootstrap.servers' must be set when 'quarkus.kubernetes-service-binding.enabled' has been set to 'true'");
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy