Bird
Raised Fist0

Given this Kafka Connect source connector configuration snippet:

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

What will happen when this connector runs?
AIt fails because 'tasks.max' must be an integer, not a string
BIt reads data from /tmp/input.txt and writes it to the Kafka topic 'test-topic'
CIt creates a new Kafka topic named '/tmp/input.txt'
DIt writes data from Kafka topic 'test-topic' to /tmp/input.txt
Step-by-Step Solution
Solution:
  1. Step 1: Identify connector type and purpose

    The "FileStreamSource" connector reads data from a file and sends it to a Kafka topic.
  2. Step 2: Understand configuration keys

    "file" specifies the input file, "topic" specifies the Kafka topic to write to, and "tasks.max" as a string is acceptable in JSON configs.
  3. Final Answer:

    It reads data from /tmp/input.txt and writes it to the Kafka topic 'test-topic' -> Option B
  4. Quick Check:

    FileStreamSource reads file to topic [OK]
Quick Trick: FileStreamSource reads file into Kafka topic [OK]
Common Mistakes:
MISTAKES
  • Confusing source and sink connectors
  • Thinking 'tasks.max' must be integer type (string is valid in JSON)
  • Assuming connector creates topics automatically

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes