use of io.quarkus.kafka.client.deployment.KafkaBuildTimeConfig in project camel-quarkus by apache.
the class KafkaProcessor method configureKafkaComponentForDevServices.
@BuildStep(onlyIfNot = IsNormal.class, onlyIf = GlobalDevServicesConfig.Enabled.class)
public void configureKafkaComponentForDevServices(DevServicesLauncherConfigResultBuildItem devServiceResult, KafkaBuildTimeConfig kafkaBuildTimeConfig, BuildProducer<RunTimeConfigurationDefaultBuildItem> runTimeConfig) {
Config config = ConfigProvider.getConfig();
Optional<String> brokers = config.getOptionalValue(CAMEL_KAFKA_BROKERS, String.class);
if (brokers.isEmpty() && kafkaBuildTimeConfig.devservices.enabled.orElse(true)) {
String kafkaBootstrapServers = devServiceResult.getConfig().get(KAFKA_BOOTSTRAP_SERVERS);
if (kafkaBootstrapServers != null) {
runTimeConfig.produce(new RunTimeConfigurationDefaultBuildItem(CAMEL_KAFKA_BROKERS, kafkaBootstrapServers));
}
}
}
Aggregations