Kafka Camel service throwing SASLAuthenticationException for invalid credentials

53 views Asked by At

I am using a kafka-camel-quarkus service which routes messages from one topic to another. When the kafka client (due to some connectivity issues) restarts, the service which is up and running, starts throwing an exception like below.

"message":"Exception org.apache.kafka.common.errors.SaslAuthenticationException caught by thread while polling topic from kafka: Authentication failed: Invalid username or password" Exhausted after delivery attempt: 1 caught: org.apache.kafka.common.errors.SaslAuthenticationException: Authentication failed: Invalid username or password

This happens for all the topics that are being listened by the service. As a workaraound, the service had to restarted which then resolves this issue.

Below is the kafka configuration i use

bootstrap.servers=localhost:9092
security.protocol=SASL_SSL
sasl.mechanism=PLAIN
sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule 
required username="<username>" password="<password>";

What causes this issue? Is it service related or kafka client config related? Instead of manual restart is there a way to bypass this?

I tried replicating the scenario by shutting down the kafka container locally. But failed to replicate the exact scenario.

0

There are 0 answers