You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In what version(s) of Spring for Apache Kafka are you seeing this issue?
spring-kafka:3.0.4
kafka-clients:3.3.2
Describe the bug
Tryied to create a native springboot with kafka using microsoft azure eventhub Kafka layer. That uses SASL PLAIN.
Run as docker image build with mvn -DskipTests -Pnative,nativeTest spring-boot:build-image
Failure to create KafkaConsumer Caused by: org.apache.kafka.common.KafkaException: org.apache.kafka.common.KafkaException: Could not find a public no-argument constructor for org.apache.kafka.common.security.authenticator.SaslClientCallbackHandler
While we provided some hints to get a basic Spring for Apache Kafka application running as a native image, we (Spring) can't take on the responsibility of making all aspects of the kafka-clients native compatible.
You can add your own hints or reproduce the issue without Spring and raise an issue over there.
If you get it working with your own hints, we'd consider accepting a PR, if you want to contribute it.
I'd prefer to have Apache Kafka client-specific native hints exactly in Apache Kafka.
Spring does nothing with that reflection around org.apache.kafka.common.security.authenticator.SaslClientCallbackHandler, so it is unfair to ask us to fix something what really is out of this project scope.
Sure! It is easy to have a RuntimeHintsRegistrar implementation for Spring AOT, but it is already a target project feature if you can't convince Apache Kafka to add native images support.
I've got my Spring Kafka consumers compiling as native image. There is a core Java security hint needed in my case which I am narrowing down from the dump I got from the tracing agent.
The kicker for me right now is the ErrorHandlingDeserializer, since it serializes exceptions into the header. I plan to implement a version that just stores the stack trace instead.
The DeadLetterPublishingRecoverer (or any recoverer that wants to analyze the problem) needs access to the raw data (byte[]) that couldn't be deserialized (currently a field on the DeserializationException).
I suppose you could add that as a separate header and add code to the DLPR to get it from there, if present.
The DeadLetterPublishingRecoverer needs access to the raw data (byte[]) that couldn't be deserialized (currently a field on the DeserializationException.
I suppose you could add that as a separate header and add code to the DLPR to get it from there, if present.
In what version(s) of Spring for Apache Kafka are you seeing this issue?
spring-kafka:3.0.4
kafka-clients:3.3.2
Describe the bug
Tryied to create a native springboot with kafka using microsoft azure eventhub Kafka layer. That uses SASL PLAIN.
Run as docker image build with
mvn -DskipTests -Pnative,nativeTest spring-boot:build-image
Failure to create KafkaConsumer Caused by: org.apache.kafka.common.KafkaException: org.apache.kafka.common.KafkaException: Could not find a public no-argument constructor for org.apache.kafka.common.security.authenticator.SaslClientCallbackHandler
To Reproduce
Using the following application.properties:
Expected behavior
With the normal (non-native), the app runs normally.
Maybe related:
#2545
Stacktrace
The text was updated successfully, but these errors were encountered: