You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2021/10/06 09:33:26 UTC

[GitHub] [camel-quarkus] aldettinger commented on a change in pull request #3161: Check whether service binding is enabled before creating QuarkusKafkaClientFactory

aldettinger commented on a change in pull request #3161:
URL: https://github.com/apache/camel-quarkus/pull/3161#discussion_r723059935



##########
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:
       Are we ok with the "quarkus.kubernetes-service-binding.enabled" default value = true ? In this case, I would expect isPresent() to be false and then it has the same effect as "quarkus.kubernetes-service-binding.enabled=false" ?




-- 
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-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org