Interview questions
Question 154 of 254
FreeWhat is Spring Kafka, and how do you produce and consume messages with it?
Messaging
Spring for Apache Kafka wraps the raw Kafka client APIs in Spring-idiomatic abstractions — a `KafkaTemplate` for producing messages (send a value, optionally with a key, to a named topic), and `@KafkaListener` on a method for consuming, which Spring Boot auto-configures to start a listener container polling the specified topic and invoking the annotated method for each received record.
Intermediate5 min
