I have a spring boot application that use spring-kafka to connect to an azure event hub ( kafka enabled);
These are the SASL Consumer properties:
props.put(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG, "SASL_SSL");
props.put(SaslConfigs.SASL_MECHANISM, "PLAIN");
props.put(SaslConfigs.SASL_JAAS_CONFIG,
"org.apache.kafka.common.security.plain.PlainLoginModule required username=\"$ConnectionString\" password=\"Endpoint=sb://XXXXX.servicebus.windows.net/;SharedAccessKeyName=ZZZZZZ-pol;SharedAccessKey=YYYYY";"
);
And this is the consumer:
@KafkaListener(
topics = "${my-topic}",
groupId = "$Default",
concurrency = "${my-concurrency}"
)
public void listener(String message) {...}
Unfortunately, when the consumer try to connect to the topic I get this error:
java.lang.RuntimeException: non-nullable field authBytes was serialized as null
Before that,I can see from the log that these fases are terminated succesfully:
- Set SASL client state to RECEIVE_APIVERSIONS_RESPONSE
- Set SASL client state to SEND_HANDSHAKE_REQUEST
- Set SASL client state to RECEIVE_HANDSHAKE_RESPONSE
- Set SASL client state to INITIAL
- Set SASL client state to INTERMEDIATE
Ant suggestions?