Challenge - 5 Problems
Kafka Sink Connector Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
What is the output of this Kafka Connect sink connector configuration?
Given the following sink connector configuration snippet, what will be the value of the
topics property after parsing?Kafka
{
"name": "my-sink-connector",
"config": {
"connector.class": "FileStreamSink",
"tasks.max": "1",
"topics": "topic1,topic2,topic3",
"file": "/tmp/output.txt"
}
}Attempts:
2 left
💡 Hint
The topics property is a string listing topics separated by commas.
✗ Incorrect
The 'topics' property in Kafka Connect sink connector config is a single string with comma-separated topic names. It is not automatically parsed into a list.
🧠 Conceptual
intermediate1:30remaining
Which option best describes the role of a Kafka Sink Connector?
What is the main purpose of a Kafka Sink Connector in Kafka Connect?
Attempts:
2 left
💡 Hint
Sink connectors move data out of Kafka.
✗ Incorrect
Sink connectors consume data from Kafka topics and write it to external systems like databases, files, or other services.
🔧 Debug
advanced2:30remaining
Identify the error in this sink connector configuration snippet
This sink connector configuration is intended to write Kafka topic data to a file. What error will it cause?
Kafka
{
"name": "file-sink",
"config": {
"connector.class": "FileStreamSink",
"tasks.max": 1,
"topics": ["my-topic"],
"file": "/tmp/output.log"
}
}Attempts:
2 left
💡 Hint
The 'topics' property expects a string, not an array.
✗ Incorrect
The 'topics' property must be a comma-separated string, not a JSON array. Using an array causes a configuration parsing error.
📝 Syntax
advanced2:00remaining
Which option correctly defines a sink connector with exactly 3 tasks?
Select the valid JSON snippet that sets up a sink connector with 3 parallel tasks.
Attempts:
2 left
💡 Hint
The 'tasks.max' property must be a string representing a number.
✗ Incorrect
In Kafka Connect configurations, numeric values like 'tasks.max' must be strings. Option A correctly uses "3" as a string.
🚀 Application
expert3:00remaining
How many tasks will run for this sink connector configuration?
Consider this sink connector config:
{
"name": "multi-task-sink",
"config": {
"connector.class": "FileStreamSink",
"tasks.max": "5",
"topics": "topicA,topicB"
}
}
If the Kafka Connect cluster has only 3 worker nodes available, how many tasks will actually run?
Attempts:
2 left
💡 Hint
Some connectors limit the number of tasks regardless of 'tasks.max'.
✗ Incorrect
The FileStreamSink connector supports only a single task regardless of the 'tasks.max' setting. So only 1 task runs.