jamesnetherton commented on a change in pull request #3161: URL: https://github.com/apache/camel-quarkus/pull/3161#discussion_r723173278
########## File path: extensions/kafka/runtime/src/main/java/org/apache/camel/quarkus/component/kafka/KafkaClientFactoryProducer.java ########## @@ -33,13 +35,30 @@ @Identifier("default-kafka-broker") Map<String, Object> kafkaConfig; + @Inject + CamelKafkaRuntimeConfig camelKafkaRuntimeConfig; + + @Inject + Config config; + @Produces @Singleton @DefaultBean - public KafkaClientFactory kafkaClientFactory(CamelKafkaRuntimeConfig config) { - if (kafkaConfig != null && !kafkaConfig.isEmpty() && config.kubernetesServiceBinding.mergeConfiguration) { + public KafkaClientFactory kafkaClientFactory() { + if (isQuarkusKafkaClientFactoryRequired()) { return new QuarkusKafkaClientFactory(kafkaConfig); } return null; } + + private boolean isQuarkusKafkaClientFactoryRequired() { + Optional<Boolean> serviceBindingEnabled = config.getOptionalValue( + "quarkus.kubernetes-service-binding.enabled", + Boolean.class); Review comment: FWIW - Ideally I don't want to be looking up config values in this way. But the current state of `quarkus-kubernetes-service-binding` mandates it. I have a more optimised way of doing the `KafkaClientFacotry` setup, but it would need some changes on the Quarkus side. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org