Bird
Raised Fist0

Given this connector configuration snippet:

medium📝 Predict Output Q13 of Q15
Kafka - Connect
Given this connector configuration snippet:
{
  "name": "my-source-connector",
  "config": {
    "connector.class": "FileStreamSource",
    "tasks.max": "1",
    "file": "/tmp/input.txt",
    "topic": "test-topic"
  }
}

What will this connector do when started?
ACreate a new Kafka topic named '/tmp/input.txt'
BRead data from /tmp/input.txt and send it to Kafka topic 'test-topic'
CWrite data from Kafka topic 'test-topic' to /tmp/input.txt
DMonitor the file /tmp/input.txt for changes but do not send data
Step-by-Step Solution
Solution:
  1. Step 1: Identify connector type and direction

    The connector class is FileStreamSource, which reads from a file and sends data to Kafka.
  2. Step 2: Understand configuration parameters

    The file parameter points to the input file, and topic specifies the Kafka topic to send data to.
  3. Final Answer:

    Read data from /tmp/input.txt and send it to Kafka topic 'test-topic' -> Option B
  4. Quick Check:

    FileStreamSource reads file to Kafka = C [OK]
Quick Trick: FileStreamSource reads file and sends to Kafka topic [OK]
Common Mistakes:
MISTAKES
  • Confusing source with sink connectors
  • Thinking it writes to the file instead of reading
  • Assuming it creates topics automatically

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes