0
0
Kafkadevops~10 mins

Source connectors in Kafka - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the connector class for a source connector.

Kafka
{
  "name": "my-source-connector",
  "connector.class": "[1]",
  "tasks.max": "1"
}
Drag options to blanks, or click blank then click option'
AJdbcSinkConnector
BFileStreamSinkConnector
CFileStreamSourceConnector
DConsoleSinkConnector
Attempts:
3 left
💡 Hint
Common Mistakes
Using a sink connector class instead of a source connector class.
Confusing source and sink connectors.
2fill in blank
medium

Complete the code to set the Kafka topic where the source connector will send data.

Kafka
{
  "name": "my-source-connector",
  "connector.class": "FileStreamSourceConnector",
  "tasks.max": "1",
  "topic": "[1]"
}
Drag options to blanks, or click blank then click option'
Ainput-topic
Boutput-topic
Csource-topic
Dsink-topic
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'sink-topic' which is usually for sink connectors.
Confusing source and sink topic names.
3fill in blank
hard

Fix the error in the connector configuration key for the file path.

Kafka
{
  "name": "my-source-connector",
  "connector.class": "FileStreamSourceConnector",
  "tasks.max": "1",
  "topic": "input-topic",
  "file[1]": "/tmp/test.txt"
}
Drag options to blanks, or click blank then click option'
A_filepath
B_path
C.filepath
D.path
Attempts:
3 left
💡 Hint
Common Mistakes
Using dot notation instead of underscore in property keys.
Guessing property names without checking documentation.
4fill in blank
hard

Fill both blanks to configure a JDBC source connector with the correct class and mode.

Kafka
{
  "name": "jdbc-source-connector",
  "connector.class": "[1]",
  "mode": "[2]",
  "tasks.max": "1"
}
Drag options to blanks, or click blank then click option'
Aio.confluent.connect.jdbc.JdbcSourceConnector
Bio.confluent.connect.jdbc.JdbcSinkConnector
Cincrementing
Dbulk
Attempts:
3 left
💡 Hint
Common Mistakes
Using the sink connector class instead of the source connector class.
Confusing mode values like 'bulk' and 'incrementing'.
5fill in blank
hard

Fill all three blanks to create a source connector configuration that reads from a file and sends to a topic.

Kafka
{
  "name": "file-source-connector",
  "connector.class": "[1]",
  "file[2]": "/var/log/app.log",
  "topic": "[3]",
  "tasks.max": "1"
}
Drag options to blanks, or click blank then click option'
AFileStreamSourceConnector
B_path
Capp-logs
DFileStreamSinkConnector
Attempts:
3 left
💡 Hint
Common Mistakes
Using sink connector class instead of source.
Using dot instead of underscore in property keys.
Choosing unrelated topic names.