You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2021/03/09 11:44:13 UTC
[camel] branch master updated: CAMEL-16138: Resolve class of
AuthenticationCallBackHandler to avoid ClassNotFoundException in OSGI
environment. (#5188)
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new 51af267 CAMEL-16138: Resolve class of AuthenticationCallBackHandler to avoid ClassNotFoundException in OSGI environment. (#5188)
51af267 is described below
commit 51af26786f52d92cb0128be1c08cd83ce40a8522
Author: Jörg Jansen <57...@users.noreply.github.com>
AuthorDate: Tue Mar 9 12:43:39 2021 +0100
CAMEL-16138: Resolve class of AuthenticationCallBackHandler to avoid ClassNotFoundException in OSGI environment. (#5188)
---
.../main/java/org/apache/camel/component/kafka/KafkaEndpoint.java | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaEndpoint.java b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaEndpoint.java
index 950cbfa..6bba62c 100644
--- a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaEndpoint.java
+++ b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaEndpoint.java
@@ -33,6 +33,7 @@ import org.apache.camel.util.CastUtils;
import org.apache.kafka.clients.consumer.ConsumerConfig;
import org.apache.kafka.clients.producer.Partitioner;
import org.apache.kafka.clients.producer.ProducerConfig;
+import org.apache.kafka.common.security.auth.AuthenticateCallbackHandler;
import org.apache.kafka.common.serialization.Deserializer;
import org.apache.kafka.common.serialization.Serializer;
import org.slf4j.Logger;
@@ -123,6 +124,10 @@ public class KafkaEndpoint extends DefaultEndpoint implements MultipleConsumersS
replaceWithClass(props, ProducerConfig.PARTITIONER_CLASS_CONFIG, resolver, Partitioner.class);
replaceWithClass(props, ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, resolver, Deserializer.class);
replaceWithClass(props, ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, resolver, Deserializer.class);
+
+ // as long as the property is not available in Kafka client, use a static string
+ final String CH_PROPERTY = "sasl.login.callback.handler.class";
+ replaceWithClass(props, CH_PROPERTY, resolver, AuthenticateCallbackHandler.class);
}
} catch (Exception t) {
// can ignore and Kafka itself might be able to handle it, if not,