1

Are there examples of configuring SpecificAvroSerdes (or any schema registry-based serdes - JsonSchema and Protobuf) in spring-kafka that allow leveraging some of the autoconfiguration (based on yaml or properties files).

There are a few similar questions in SO like How to use Spring-Kafka to read AVRO message with Confluent Schema registry?

But I want to be a bit specific on Kafka Streams serdes and declarative configuration of the Serdes.

Thank you

Vik Gamov
  • 5,446
  • 1
  • 26
  • 46

1 Answers1

0

Looks like Kafka Streams can be configured with the default Serde. See StreamsConfig.DEFAULT_KEY_SERDE_CLASS_CONFIG and StreamsConfig.DEFAULT_VALUE_SERDE_CLASS_CONFIG.

According Spring Boot convention we can provide any arbitrary properties from YAML file: https://docs.spring.io/spring-boot/docs/2.4.0/reference/html/spring-boot-features.html#boot-features-kafka-extra-props

So, probably your SpecificAvroSerdes can be configured in the application.properties like this:

spring.kafka.streams.properties[default.value.serde]=io.confluent.kafka.streams.serdes.avro.SpecificAvroSerdes
Artem Bilan
  • 113,505
  • 11
  • 91
  • 118