0
0
Kafkadevops~10 mins

Why connectors integrate external systems in Kafka - Test Your Understanding

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

Complete the code to create a Kafka connector that reads data from an external database.

Kafka
connector_config = {
    "name": "my-connector",
    "connector.class": "[1]",
    "tasks.max": "1",
    "connection.url": "jdbc:mysql://localhost:3306/mydb"
}
Drag options to blanks, or click blank then click option'
Aorg.apache.kafka.connect.transforms.TimestampRouter
Borg.apache.kafka.connect.file.FileStreamSourceConnector
Cio.confluent.connect.jdbc.JdbcSourceConnector
Dorg.apache.kafka.connect.mirror.MirrorSourceConnector
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing a connector class that reads from files instead of databases.
Using a connector class meant for mirroring Kafka topics.
2fill in blank
medium

Complete the code to specify the Kafka topic where data from the external system will be sent.

Kafka
connector_config = {
    "name": "my-connector",
    "topic": "[1]",
    "connector.class": "io.confluent.connect.jdbc.JdbcSourceConnector"
}
Drag options to blanks, or click blank then click option'
Aexternal_data
Bmydb
Cconnect-config
Dkafka_topic
Attempts:
3 left
💡 Hint
Common Mistakes
Using the database name as the topic name.
Using a Kafka internal config name as the topic.
3fill in blank
hard

Fix the error in the connector configuration to properly specify the maximum number of tasks.

Kafka
connector_config = {
    "name": "my-connector",
    "tasks.max": [1],
    "connector.class": "io.confluent.connect.jdbc.JdbcSourceConnector"
}
Drag options to blanks, or click blank then click option'
Atrue
B"max"
C"one"
D1
Attempts:
3 left
💡 Hint
Common Mistakes
Putting the number inside quotes making it a string.
Using boolean values instead of numbers.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps table names to their Kafka topics only if the table name starts with 'user'.

Kafka
table_topic_map = {table: table[1] for table in tables if table[2]'user')}
Drag options to blanks, or click blank then click option'
A.upper()
B==
C.startswith(
D!=
Attempts:
3 left
💡 Hint
Common Mistakes
Using equality operator instead of startswith.
Not applying a string method to the topic name.
5fill in blank
hard

Fill all three blanks to create a filtered dictionary comprehension that maps uppercase table names to their topics only if the table name length is greater than 4.

Kafka
filtered_map = {table[1]: table for table in tables if len(table) [2] [3]
Drag options to blanks, or click blank then click option'
A.upper()
B>
C4
D<
Attempts:
3 left
💡 Hint
Common Mistakes
Using less than operator instead of greater than.
Not converting table names to uppercase.