0
0
Kafkadevops~20 mins

Connector configuration in Kafka - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Kafka Connector Mastery
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 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"
  }
}
AValidation failed: 'file' property path does not exist.
BValidation failed: 'tasks.max' must be an integer, not a string.
CValidation failed: Missing required property 'topic'.
DValidation successful: Connector configuration is valid.
Attempts:
2 left
💡 Hint
Check the data types of the configuration properties.
Predict Output
intermediate
2: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"
  }
}
AValidation failed: 'topics' property must be 'topic' (singular).
BValidation failed: 'file' property must be a string path, not a number.
CNo error, configuration is valid.
DValidation failed: 'tasks.max' must be a string, not an integer.
Attempts:
2 left
💡 Hint
Check the data types of each property carefully.
🔧 Debug
advanced
2: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"
  }
}
AThe 'tasks.max' value cannot be greater than 2 for this connector.
BThe 'value.converter.schemas.enable' must be a boolean true/false, not a string.
CThe connector class 'JsonFileSource' does not exist in Kafka Connect.
DThe 'topic' property is misspelled; it should be 'topics'.
Attempts:
2 left
💡 Hint
Check if the connector class is a valid built-in or custom connector.
📝 Syntax
advanced
2:00remaining
Which configuration JSON is syntactically correct for a Kafka connector?
Select the syntactically correct Kafka connector configuration JSON.
A
{
  "name": "my-connector",
  "config": {
    "connector.class": "FileStreamSource",
    "tasks.max": 1,
    "file": "/tmp/input.txt",
    "topic": "my-topic"
  }
}
B
{
  "name": "my-connector",
  "config": {
    "connector.class": "FileStreamSource",
    "tasks.max": "one",
    "file": "/tmp/input.txt",
    "topic": "my-topic"
  }
}
C
}
}  
"cipot-ym" :"cipot"    
,"txt.tupni/pmt/" :"elif"    
,1 :"xam.sksat"    
,"ecruoSmaertSeliF" :"ssalc.rotcennoc"    
{ :"gifnoc"  
,"rotcennoc-ym" :"eman"  
{
D
{
  "name": "my-connector",
  "config": {
    "connector.class": "FileStreamSource",
    "tasks.max": 1
    "file": "/tmp/input.txt",
    "topic": "my-topic"
  }
}
Attempts:
2 left
💡 Hint
Look for missing commas, trailing commas, and correct data types.
🚀 Application
expert
2: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"
  }
}
AOnly 1 task will run because the connector supports a single task.
BThe number of tasks is decided by the number of partitions in the topic, ignoring 'tasks.max'.
CKafka Connect will run 0 tasks because 'file' path is invalid.
DExactly 4 tasks will run as specified by 'tasks.max'.
Attempts:
2 left
💡 Hint
Consider the connector type and its support for parallel tasks.