Recall & Review
beginner
What does SerDes stand for in Kafka?
SerDes stands for Serializer/Deserializer. It converts data to bytes for sending and back to objects when receiving.
Click to reveal answer
beginner
Why create a custom SerDes in Kafka?
To handle special data formats or complex objects that default serializers can't process well.
Click to reveal answer
intermediate
What two main methods must a Kafka Serializer implement?
The methods are
serialize(String topic, T data) to convert data to bytes, and close() to release resources.Click to reveal answer
beginner
What is the role of the Deserializer in a Kafka SerDes?
It converts byte arrays back into objects so the consumer can use the data in its original form.
Click to reveal answer
intermediate
How do you register a custom SerDes in Kafka producer or consumer?
You set the
key.serializer or value.serializer (for producer) and key.deserializer or value.deserializer (for consumer) properties to your custom Serializer and Deserializer classes respectively.Click to reveal answer
What is the main purpose of a Kafka Serializer?
✗ Incorrect
A serializer converts objects into byte arrays so Kafka can send them over the network.
Which interface must you implement to create a custom Kafka Deserializer?
✗ Incorrect
The Deserializer interface is used to convert byte arrays back into objects.
If your data is a complex Java object, what is a good reason to create a custom SerDes?
✗ Incorrect
Custom SerDes allow you to control how complex objects are converted to bytes and back.
Where do you specify your custom SerDes class in Kafka configuration?
✗ Incorrect
You set the serializer and deserializer properties to your custom class in producer or consumer configs.
What happens if you don't implement the
close() method in your custom SerDes?✗ Incorrect
The close method helps clean up resources like streams or buffers to avoid memory leaks.
Explain how a custom SerDes works in Kafka and why you might need one.
Think about how data travels from your program to Kafka and back.
You got /4 concepts.
Describe the steps to create and use a custom SerDes in a Kafka application.
Focus on coding and configuration steps.
You got /4 concepts.