Complete the code to specify the connector class for a source connector.
{
"name": "my-source-connector",
"connector.class": "[1]",
"tasks.max": "1"
}The connector.class property defines the connector type. For a source connector reading from a file, FileStreamSourceConnector is correct.
Complete the code to set the Kafka topic where the source connector will send data.
{
"name": "my-source-connector",
"connector.class": "FileStreamSourceConnector",
"tasks.max": "1",
"topic": "[1]"
}The topic property defines the Kafka topic where the source connector sends data. 'input-topic' is a common name for such a topic.
Fix the error in the connector configuration key for the file path.
{
"name": "my-source-connector",
"connector.class": "FileStreamSourceConnector",
"tasks.max": "1",
"topic": "input-topic",
"file[1]": "/tmp/test.txt"
}The correct property key for the file path in FileStreamSourceConnector is file_path using an underscore.
Fill both blanks to configure a JDBC source connector with the correct class and mode.
{
"name": "jdbc-source-connector",
"connector.class": "[1]",
"mode": "[2]",
"tasks.max": "1"
}The JDBC source connector class is io.confluent.connect.jdbc.JdbcSourceConnector. The mode can be set to incrementing to fetch new rows based on an incrementing column.
Fill all three blanks to create a source connector configuration that reads from a file and sends to a topic.
{
"name": "file-source-connector",
"connector.class": "[1]",
"file[2]": "/var/log/app.log",
"topic": "[3]",
"tasks.max": "1"
}The source connector class is FileStreamSourceConnector. The file path property uses underscore as file_path. The topic name app-logs is a suitable Kafka topic for logs.