SpringSpring Kafka Configuration
How do you configure Spring Kafka for Avro with Confluent Schema Registry?
Reference answer
Add confluent-kafka-avro-serializer dependency. Producer config: spring.kafka.producer.value-serializer=io.confluent.kafka.serializers.KafkaAvroSerializer, spring.kafka.producer.properties.schema.registry.url=http://schema-registry:8081. Consumer config: spring.kafka.consumer.value-deserializer=io.confluent.kafka.serializers.KafkaAvroDeserializer, spring.kafka.consumer.properties.schema.registry.url=http://schema-registry:8081, spring.kafka.consumer.properties.specific.avro.reader=true. Generate Java classes from .avsc files using avro-maven-plugin. The serializer automatically registers/fetches schemas.
Expected key concepts: KafkaAvroSerializer, KafkaAvroDeserializer, schema.registry.url, specific.avro.reader, avro-maven-plugin, confluent, schema registration, fetch schemas, application.yml