Challenge - 5 Problems
Kafka Source 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 source connector configuration?
Given this JSON configuration for a Kafka Connect source connector, what will be the value of the
tasks.max property when the connector starts?Kafka
{
"name": "my-source-connector",
"config": {
"connector.class": "FileStreamSource",
"tasks.max": "3",
"file": "/tmp/input.txt",
"topic": "test-topic"
}
}Attempts:
2 left
💡 Hint
Check the value assigned to tasks.max in the config JSON.
✗ Incorrect
The tasks.max property is set to the string "3" which Kafka Connect parses as integer 3, so the connector will start with 3 tasks.
🧠 Conceptual
intermediate1:30remaining
Which Kafka Connect source connector property controls the maximum number of tasks?
In Kafka Connect source connectors, which configuration property defines the maximum number of tasks that can be created to read data?
Attempts:
2 left
💡 Hint
It controls parallelism of the connector.
✗ Incorrect
The tasks.max property controls how many tasks the connector can create to read data in parallel.
❓ Predict Output
advanced2:00remaining
What error does this source connector configuration cause?
What error will Kafka Connect raise when starting this source connector?
Kafka
{
"name": "invalid-connector",
"config": {
"connector.class": "FileStreamSource",
"tasks.max": "zero",
"file": "/tmp/input.txt",
"topic": "test-topic"
}
}Attempts:
2 left
💡 Hint
Check the value type of tasks.max.
✗ Incorrect
The tasks.max property must be a positive integer. The string "zero" is invalid and causes a configuration error.
🚀 Application
advanced2:00remaining
How many tasks will be created with this source connector config?
If a source connector is configured with
tasks.max set to 5, but the connector's taskConfigs method returns only 3 task configurations, how many tasks will Kafka Connect create?Attempts:
2 left
💡 Hint
The number of tasks is limited by the number of task configurations returned.
✗ Incorrect
Kafka Connect creates as many tasks as the number of task configurations returned by the connector, up to tasks.max. Here, only 3 task configs are returned, so 3 tasks are created.
🔧 Debug
expert2:30remaining
Why does this source connector fail to start?
This source connector configuration fails to start. What is the cause?
Kafka
{
"name": "my-source",
"config": {
"connector.class": "org.apache.kafka.connect.file.FileStreamSourceConnector",
"tasks.max": "2",
"file": "/tmp/input.txt"
}
}Attempts:
2 left
💡 Hint
Check if all required properties for FileStreamSourceConnector are present.
✗ Incorrect
The FileStreamSourceConnector requires the 'topic' property to specify the Kafka topic to write to. Without it, the connector fails to start.