Challenge - 5 Problems
Kafka Connector Mastery
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 connector configuration validation?
Given the following Kafka connector configuration JSON, what will be the result of the connector validation?
Kafka
{
"name": "my-source-connector",
"config": {
"connector.class": "FileStreamSource",
"tasks.max": "2",
"file": "/tmp/test.txt",
"topic": "test-topic"
}
}Attempts:
2 left
💡 Hint
Check the data types of the configuration properties.
✗ Incorrect
The 'tasks.max' property can be provided as a string and will be parsed as an integer by Kafka Connect. All required properties are present and valid.
❓ Predict Output
intermediate2:00remaining
What error does this Kafka sink connector configuration produce?
Analyze the following sink connector configuration and determine the error it will cause when deployed.
Kafka
{
"name": "my-sink-connector",
"config": {
"connector.class": "FileStreamSink",
"tasks.max": 1,
"file": 12345,
"topics": "my-topic"
}
}Attempts:
2 left
💡 Hint
Check the data types of each property carefully.
✗ Incorrect
The 'file' property must be a string representing the file path. Providing a number causes a validation error.
🔧 Debug
advanced2:00remaining
Why does this Kafka connector fail to start?
This connector configuration fails to start. Identify the cause.
Kafka
{
"name": "json-source-connector",
"config": {
"connector.class": "JsonFileSource",
"tasks.max": 3,
"file": "/data/input.json",
"topic": "json-topic",
"value.converter": "org.apache.kafka.connect.json.JsonConverter",
"value.converter.schemas.enable": "false"
}
}Attempts:
2 left
💡 Hint
Check if the connector class is a valid built-in or custom connector.
✗ Incorrect
Kafka Connect does not have a built-in connector named 'JsonFileSource'. This causes the connector to fail at startup.
📝 Syntax
advanced2:00remaining
Which configuration JSON is syntactically correct for a Kafka connector?
Select the syntactically correct Kafka connector configuration JSON.
Attempts:
2 left
💡 Hint
Look for missing commas, trailing commas, and correct data types.
✗ Incorrect
Option A is valid JSON with correct commas and data types. Option A misses a comma after 'tasks.max'. Option A has a trailing comma after the last property. Option A uses a string 'one' instead of an integer for 'tasks.max'.
🚀 Application
expert2:00remaining
How many tasks will this Kafka connector run?
Given this connector configuration, how many tasks will Kafka Connect run?
Kafka
{
"name": "multi-task-connector",
"config": {
"connector.class": "FileStreamSource",
"tasks.max": 4,
"file": "/var/log/app.log",
"topic": "app-logs"
}
}Attempts:
2 left
💡 Hint
Consider the connector type and its support for parallel tasks.
✗ Incorrect
The FileStreamSource connector supports only a single task regardless of 'tasks.max' value. So only 1 task will run.