SpringSpring Kafka Basics
How do you configure a Kafka consumer in Spring Boot?
Reference answer
Add the spring-kafka dependency; Spring Boot auto-configures Kafka support from spring.kafka.* properties. In application.yml set spring.kafka.bootstrap-servers, spring.kafka.consumer.group-id, spring.kafka.consumer.auto-offset-reset and, if needed, spring.kafka.consumer.key-deserializer and spring.kafka.consumer.value-deserializer (both default to StringDeserializer). Put @KafkaListener(topics = "my-topic") on a method of a bean to receive messages; the groupId attribute sets the group for that listener. If you define no KafkaListenerContainerFactory bean, Boot configures a default one using the spring.kafka.listener.* properties (for example concurrency, ack-mode and type). For JSON values set the value deserializer to JacksonJsonDeserializer (Spring Kafka 4.x; JsonDeserializer in earlier versions) and pass spring.json.trusted.packages and spring.json.value.default.type through spring.kafka.consumer.properties.
Expected key concepts: spring.kafka.bootstrap-servers, group-id, auto-offset-reset, @KafkaListener, KafkaListenerContainerFactory, spring.kafka.listener, StringDeserializer, JacksonJsonDeserializer, application.yml
How did that feel?
Your own verdict, not the score. It shows up next to this question in the list, so you can come back to the shaky ones.