Issue while connecting confluent kafka using Camel spring DSL

Solution Verified - Updated -

Issue

  • I am trying to connect confluent kafka with SASL_SSL using camel spring DSL and facing below error. Please assist with sample code & how to set up jaas configs.

  • My code is

<route id="_route3" streamCache="true">
            <from id="route-timer" uri="timer:foo?period=2000"/>
            <!-- <to id="_tk1" uri="kafka:{{kafkaserver}}?kerberosRenewWindowFactor=8&amp;kerberosRenewJitter=1&amp;topic={{kafkatopic}}"/> -->
            <!-- <to id="_tk1" uri="kafka:brokerurl:9094?kerberosRenewWindowFactor=8&amp;kerberosRenewJitter=1&amp;topic=sampleTopic"/> -->
            <transform id="route-transform">
                <method ref="myTransformer"/>
            </transform>
            <log id="_login" message="Kafka producer : ${body}"/>
            <to id="_tk" uri="kafka:brokerUrl:9094?kerberosRenewWindowFactor=8&amp;kerberosRenewJitter=1&amp;topic=Test_Topic&amp;keySerializerClass=org.apache.kafka.common.serialization.StringSerializer&amp;SerializerClass=org.apache.kafka.common.serialization.StringSerializer&amp;
securityProtocol=SASL_SSL&amp;sslProtocol=TLSv1.2&amp;sslProtocol&amp;sslKeyPassword=keypassword&amp;
sslKeystoreLocation=src/main/resources/kafkacerts/keystore.jks&amp;sslKeystorePassword=keypassword&amp;sslTruststoreLocation=src/main/resources/kafkacerts/cacerts&amp;sslTruststorePassword=changeit"/>
        </route>
  • Error

Caused by: org.apache.kafka.common.KafkaException: org.apache.kafka.common.KafkaException: Jaas configuration not found at org.apache.kafka.common.network.SaslChannelBuilder.configure(SaslChannelBuilder.java:86) at org.apache.kafka.common.network.ChannelBuilders.create(ChannelBuilders.java:70) at org.apache.kafka.clients.ClientUtils.createChannelBuilder(ClientUtils.java:83) at org.apache.kafka.clients.producer.KafkaProducer.<init>(KafkaProducer.java:277) ... 21 more Caused by: org.apache.kafka.common.KafkaException: Jaas configuration not found at org.apache.kafka.common.security.kerberos.KerberosLogin.getServiceName(KerberosLogin.java:299) at org.apache.kafka.common.security.kerberos.KerberosLogin.configure(KerberosLogin.java:103) at org.apache.kafka.common.security.authenticator.LoginManager.<init>(LoginManager.java:45) at org.apache.kafka.common.security.authenticator.LoginManager.acquireLoginManager(LoginManager.java:68) at org.apache.kafka.common.network.SaslChannelBuilder.configure(SaslChannelBuilder.java:78) ... 24 more Caused by: java.io.IOException: Could not find a 'KafkaClient' entry in this configuration. at org.apache.kafka.common.security.JaasUtils.jaasConfig(JaasUtils.java:50) at org.apache.kafka.common.security.kerberos.KerberosLogin.getServiceName(KerberosLogin.java:297) ... 28 more

Environment

  • Red Hat Fuse
    • 7.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In