October 21, 2024
Chicago 12, Melborne City, USA
java

How to override KafkaAvroDeserializerConfig.SPECIFIC_AVRO_VALUE_TYPE_CONFIG when using Quarkus with Kafka and schema registry


We have a Quarkus project that uses Apache Kafka with Confluent schema registry and Avro.
It uses the Quarkus code generation mechanism to generate Java files from an Avro schema and it consumes from a certain Kafka topic.

The producer of this topic has made a namespace change in the Avro schema. The caused a deserialization exception in our consumer application.

Could not find class X specified in writer's schema whilst finding reader's schema for a SpecificRecord.

I know this is a Java specific problem because of the way the classes are generated. My colleagues that uses Scala have overridden KafkaAvroDeserializerConfig.SPECIFIC_AVRO_VALUE_TYPE_CONFIG to solve this problem.

Is it possible to override this config in Quarkus/smallrye?
Something like mp.messaging.incoming.[channel].specific.avro.value.type?

Should I still set mp.messaging.incoming.[channel].specific.avro.reader to true?

Is there another way of mitigating this problem?

I have tried using an alias in the reader’s schema, but I still got the same exception. I also tried "setting" mp.messaging.incoming.[channel].specific.avro.value.type, but unsure whether this property actually exists and I still got the same exception.



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video