Open diversit opened 1 month ago
@diversit Thank you for opening this detailed issue and the PR.
This was intentional, following the typical Kafka client behavior. If you pass the serde type name, configure will be called by the client constructor. I believe there was a javadoc note on that.
That being said, I think configure could've called the for creators from registered serde. Would that make sense for you ?
@ozangunalp Thanks for your reply.
I understand your point. I was in the understanding the SerDe would required configuration provided by the KafaCompanion
and I thought the getCommonClientConfig()
would not be sufficient.
From the docs registering custom serdes I had not understood I had to configure the SerDe myself. And I'm having trouble finding the Javadocs for the SmallRye projects since it does not seem to be linked from the SmallRye site or Github repo's.
Could you please point me to the Javadoc note your mentioned?
After better reading the docs of SpecificAvroSerde
I know understand I have to configure it myself with the appropriate config, before registering it with the KafkaCompanion
.
Next challenge will then be how to get the url from the Schema Registry from Quarkus in dev/test modes.
So I guess this issue can be closed then.
You can access the javadoc from here : https://javadoc.io/doc/io.smallrye.reactive/smallrye-reactive-messaging-kafka-test-companion/latest/io/smallrye/reactive/messaging/kafka/companion/ConsumerBuilder.html
Next challenge will then be how to get the url from the Schema Registry from Quarkus in dev/test modes.
If you use the KafkaCompanionResource it is done in here : https://github.com/quarkusio/quarkus/blob/50f2d3f1bd14b0b8f518d8d346422e0dc7199898/test-framework/kafka-companion/src/main/java/io/quarkus/test/kafka/KafkaCompanionResource.java#L28
The
KafkaCompanion
does not properly configure a registeredSerde
,Serializer
and/orDeserialiser
which causes issues with certain implementations.E.g. When using Confluents
io.confluent.kafka.streams.serdes.avro.SpecificAvroSerde
(and it's serializer/deserializer) not properly callingconfigure
causes a test to fail with:This behaviour can be verified by adding a test case to
SerdesTest
:which will currently fail with
KafkaCompanion
should be updated to callconfigure
on theSerde
so the Serializer and Deserialiser properly get configured before a message is published or consumed.Due to this issue, other serialisers like the
StringSerializer
,UUIDSerializer
,ListSerializer
, etc could also give unexpected results in tests.Provided a fix in PR #2757