Complete the code to set the connector name.
{
"name": "[1]",
"config": {
"connector.class": "FileStreamSource"
}
}The name field sets the unique name of the connector. Here, connector1 is used as the connector name.
Complete the code to specify the connector class.
{
"name": "source-connector",
"config": {
"connector.class": "[1]",
"tasks.max": "1"
}
}The connector.class specifies the Java class that implements the connector. FileStreamSource is the correct class for reading from a file source.
Fix the error in the configuration by completing the missing topic name.
{
"name": "file-source-connector",
"config": {
"connector.class": "FileStreamSource",
"tasks.max": "1",
"file": "/tmp/test.txt",
"topic": "[1]"
}
}The topic field specifies the Kafka topic where data will be sent. test-topic is the expected topic name here.
Fill both blanks to configure the maximum tasks and the file path.
{
"name": "file-source-connector",
"config": {
"connector.class": "FileStreamSource",
"tasks.max": "[1]",
"file": "[2]",
"topic": "test-topic"
}
}tasks.max controls how many tasks run in parallel; here it is set to 1. The file path specifies the input file; /tmp/data.txt is used here.
Fill all three blanks to complete the connector configuration with name, class, and topic.
{
"name": "[1]",
"config": {
"connector.class": "[2]",
"tasks.max": "1",
"file": "/tmp/input.txt",
"topic": "[3]"
}
}The name is set to file-source-connector, the connector.class is FileStreamSource, and the topic is input-topic. This completes the connector configuration.