Complete the code to define a Kafka Connect source connector class.
public class MySourceConnector extends [1] { }
The class must extend SourceConnector to implement a source connector in Kafka Connect.
Complete the code to start the Kafka Connect worker with the correct configuration.
Worker worker = new Worker("worker1", config, [1]);
The Worker constructor requires a herder object to manage connectors and tasks.
Fix the error in the connector configuration property key.
props.put("[1]", "my-connector");
The correct property key for naming a connector is name.
Fill both blanks to create a task configuration map with the correct keys.
Map<String, String> taskConfig = new HashMap<>(); taskConfig.put("[1]", "my-task"); taskConfig.put("[2]", "com.example.MyTask");
The task configuration uses name for the task name and task.class for the task class.
Fill all three blanks to complete the connector's taskConfigs method.
public List<Map<String, String>> taskConfigs(int maxTasks) {
List<Map<String, String>> configs = new ArrayList<>();
for (int i = 0; i < [1]; i++) {
Map<String, String> config = new HashMap<>();
config.put("[2]", "task-" + i);
config.put("[3]", this.config.get("connector.class"));
configs.add(config);
}
return configs;
}The loop runs up to maxTasks. Each task config uses name for the task name and task.class for the task class.