This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit f3da80a32d2f5e53696ebef01ee28ff7f5475e02 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Fri May 26 14:40:54 2023 +0200 CAMEL-19393: camel-kafka - Should keep the configuration value types as-is as Kafka converts this automatic. --- .../org/apache/camel/component/kafka/KafkaConfiguration.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConfiguration.java b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConfiguration.java index 07a7fee868b..e81007ffad9 100755 --- a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConfiguration.java +++ b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConfiguration.java @@ -549,7 +549,6 @@ public class KafkaConfiguration implements Cloneable, HeaderFilterStrategyAware if (keyManagers != null) { addPropertyIfNotNull(props, SslConfigs.SSL_KEYMANAGER_ALGORITHM_CONFIG, keyManagers.getAlgorithm()); addPropertyIfNotNull(props, SslConfigs.SSL_KEY_PASSWORD_CONFIG, keyManagers.getKeyPassword()); - KeyStoreParameters keyStore = keyManagers.getKeyStore(); if (keyStore != null) { addPropertyIfNotNull(props, SslConfigs.SSL_KEYSTORE_TYPE_CONFIG, keyStore.getType()); @@ -561,7 +560,6 @@ public class KafkaConfiguration implements Cloneable, HeaderFilterStrategyAware TrustManagersParameters trustManagers = sslContextParameters.getTrustManagers(); if (trustManagers != null) { addPropertyIfNotNull(props, SslConfigs.SSL_TRUSTMANAGER_ALGORITHM_CONFIG, trustManagers.getAlgorithm()); - KeyStoreParameters keyStore = trustManagers.getKeyStore(); if (keyStore != null) { addPropertyIfNotNull(props, SslConfigs.SSL_TRUSTSTORE_TYPE_CONFIG, keyStore.getType()); @@ -584,22 +582,22 @@ public class KafkaConfiguration implements Cloneable, HeaderFilterStrategyAware private static void addPropertyIfNotFalse(Properties props, String key, boolean value) { if (value) { - // Kafka expects all properties as String + // value should be as-is props.put(key, value); } } private static <T> void addPropertyIfNotEmpty(Properties props, String key, T value) { if (ObjectHelper.isNotEmpty(value)) { - // Kafka expects all properties as String - props.put(key, value.toString()); + // value should be as-is + props.put(key, value); } } private static <T> void addPropertyIfNotNull(Properties props, String key, T value) { if (value != null) { - // Kafka expects all properties as String - props.put(key, value.toString()); + // value should be as-is + props.put(key, value); } }