0
0
Kafkadevops~20 mins

Source connectors in Kafka - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Kafka Source Connector Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2: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"
  }
}
AError: tasks.max must be an integer
B1
C0
D3
Attempts:
2 left
💡 Hint
Check the value assigned to tasks.max in the config JSON.
🧠 Conceptual
intermediate
1: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?
Aoffset.flush.interval.ms
Bmax.poll.records
Ctasks.max
Dbatch.size
Attempts:
2 left
💡 Hint
It controls parallelism of the connector.
Predict Output
advanced
2: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"
  }
}
ANo error, tasks.max defaults to 1
BError: tasks.max must be a positive integer
CError: file path not found
DError: topic name missing
Attempts:
2 left
💡 Hint
Check the value type of tasks.max.
🚀 Application
advanced
2: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?
A3
B5
C0
DError: mismatch between tasks.max and taskConfigs
Attempts:
2 left
💡 Hint
The number of tasks is limited by the number of task configurations returned.
🔧 Debug
expert
2: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"
  }
}
AMissing required property: topic
BInvalid connector.class value
Ctasks.max must be an integer, not string
DFile path does not exist
Attempts:
2 left
💡 Hint
Check if all required properties for FileStreamSourceConnector are present.