0
0
Kafkadevops~10 mins

JSON Schema and Protobuf support in Kafka - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the serializer for JSON Schema in Kafka producer configuration.

Kafka
props.put("value.serializer", [1]);
Drag options to blanks, or click blank then click option'
A"org.apache.kafka.common.serialization.ByteArraySerializer"
B"org.apache.kafka.common.serialization.StringSerializer"
C"io.confluent.kafka.serializers.KafkaAvroSerializer"
D"io.confluent.kafka.serializers.KafkaJsonSchemaSerializer"
Attempts:
3 left
💡 Hint
Common Mistakes
Using StringSerializer instead of KafkaJsonSchemaSerializer
Confusing Avro serializer with JSON Schema serializer
2fill in blank
medium

Complete the code to specify the deserializer for Protobuf in Kafka consumer configuration.

Kafka
props.put("value.deserializer", [1]);
Drag options to blanks, or click blank then click option'
A"io.confluent.kafka.serializers.KafkaJsonSchemaDeserializer"
B"org.apache.kafka.common.serialization.StringDeserializer"
C"io.confluent.kafka.serializers.KafkaProtobufDeserializer"
D"io.confluent.kafka.serializers.KafkaAvroDeserializer"
Attempts:
3 left
💡 Hint
Common Mistakes
Using JSON Schema deserializer for Protobuf data
Using StringDeserializer which does not handle Protobuf
3fill in blank
hard

Fix the error in the schema registry URL configuration for Kafka producer.

Kafka
props.put("schema.registry.url", [1]);
Drag options to blanks, or click blank then click option'
A"http://localhost:8081"
B"localhost:8081"
C"https://schema-registry:8081"
D"http://schema-registry"
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting the protocol (http://)
Using only hostname without port
4fill in blank
hard

Fill both blanks to configure Kafka producer for Protobuf serialization with schema registry.

Kafka
props.put("value.serializer", [1]);
props.put("schema.registry.url", [2]);
Drag options to blanks, or click blank then click option'
A"io.confluent.kafka.serializers.KafkaProtobufSerializer"
B"http://localhost:8081"
C"io.confluent.kafka.serializers.KafkaJsonSchemaSerializer"
D"localhost:8081"
Attempts:
3 left
💡 Hint
Common Mistakes
Using JSON Schema serializer for Protobuf data
Omitting protocol in schema registry URL
5fill in blank
hard

Fill all three blanks to create a Kafka consumer configuration for JSON Schema deserialization with schema registry URL and group ID.

Kafka
props.put("value.deserializer", [1]);
props.put("schema.registry.url", [2]);
props.put("group.id", [3]);
Drag options to blanks, or click blank then click option'
A"io.confluent.kafka.serializers.KafkaJsonSchemaDeserializer"
B"http://localhost:8081"
C"json-schema-consumer-group"
D"io.confluent.kafka.serializers.KafkaProtobufDeserializer"
Attempts:
3 left
💡 Hint
Common Mistakes
Using Protobuf deserializer for JSON Schema data
Omitting group ID or schema registry URL protocol