Recall & Review
beginner
What is Apache Kafka used for in Spring Boot applications?
Apache Kafka is used as a messaging system to send and receive streams of data between different parts of an application or between different applications, enabling real-time data processing.
Click to reveal answer
beginner
What annotation is used in Spring Boot to create a Kafka listener?
The
@KafkaListener annotation is used to mark a method as a listener for Kafka messages on a specified topic.Click to reveal answer
beginner
How do you send a message to a Kafka topic in Spring Boot?
You use the
KafkaTemplate class's send() method, specifying the topic name and the message to send.Click to reveal answer
beginner
What is the role of
application.properties in Kafka integration with Spring Boot?It holds configuration settings like Kafka server addresses, topic names, and consumer group IDs to connect and communicate with Kafka brokers.
Click to reveal answer
intermediate
Why is it important to handle message serialization and deserialization in Kafka integration?
Because Kafka sends data as bytes, serialization converts objects to bytes when sending, and deserialization converts bytes back to objects when receiving, ensuring data is correctly understood.
Click to reveal answer
Which Spring Boot annotation is used to listen to Kafka messages?
✗ Incorrect
The @KafkaListener annotation marks a method to receive messages from Kafka topics.
What class do you use to send messages to Kafka in Spring Boot?
✗ Incorrect
KafkaTemplate is the Spring Boot class used to send messages to Kafka topics.
Where do you configure Kafka server addresses in a Spring Boot app?
✗ Incorrect
Kafka server addresses and other settings are typically set in application.properties.
What does Kafka use to group consumers for load balancing?
✗ Incorrect
Consumer Group ID groups consumers so they share message consumption.
Why must messages be serialized before sending to Kafka?
✗ Incorrect
Serialization converts data into bytes so Kafka can transmit it.
Explain how to set up a basic Kafka producer and consumer in Spring Boot.
Think about how you send and listen to messages and where you put settings.
You got /4 concepts.
Describe why serialization and deserialization are important in Kafka integration.
Consider how data travels between apps in Kafka.
You got /4 concepts.