0
0
Kafkadevops~10 mins

Sink connectors 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 connector class for a sink connector.

Kafka
"connector.class": "[1]",
Drag options to blanks, or click blank then click option'
AKafkaSinkConnector
BFileStreamSourceConnector
CKafkaSourceConnector
DFileStreamSinkConnector
Attempts:
3 left
💡 Hint
Common Mistakes
Using a source connector class instead of a sink connector class.
2fill in blank
medium

Complete the code to set the Kafka topic that the sink connector will consume from.

Kafka
"topics": "[1]",
Drag options to blanks, or click blank then click option'
Asource_topic
Bsink_topic
Cinput_topic
Doutput_topic
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing the topic name with the output or sink destination.
3fill in blank
hard

Fix the error in the configuration key to specify the file path for the FileStreamSinkConnector.

Kafka
"file": "[1]",
Drag options to blanks, or click blank then click option'
A/tmp/output.txt
Boutput.txt
C/var/data/output.log
Ddata/output.txt
Attempts:
3 left
💡 Hint
Common Mistakes
Using relative file paths instead of absolute paths.
4fill in blank
hard

Fill both blanks to complete the sink connector configuration that writes to a file and consumes from a topic.

Kafka
{
  "name": "file-sink-connector",
  "connector.class": "[1]",
  "tasks.max": "1",
  "topics": "[2]",
  "file": "/tmp/sink-output.txt"
}
Drag options to blanks, or click blank then click option'
AFileStreamSinkConnector
BFileStreamSourceConnector
Cinput_topic
Doutput_topic
Attempts:
3 left
💡 Hint
Common Mistakes
Using source connector class or wrong topic name.
5fill in blank
hard

Fill all three blanks to create a sink connector configuration that writes to a file, consumes from a topic, and limits tasks.

Kafka
{
  "name": "file-sink-connector",
  "connector.class": "[1]",
  "tasks.max": "[2]",
  "topics": "[3]",
  "file": "/var/log/kafka_sink.log"
}
Drag options to blanks, or click blank then click option'
AFileStreamSinkConnector
B3
Cinput_topic
DFileStreamSourceConnector
Attempts:
3 left
💡 Hint
Common Mistakes
Using source connector class, wrong tasks.max value, or wrong topic name.