Bird
Raised Fist0

Consider this Kafka Connect source connector configuration:

medium📝 Predict Output Q4 of Q15
Kafka - Connect
Consider this Kafka Connect source connector configuration:
{"name": "file-source", "connector.class": "FileStreamSource", "tasks.max": "1", "file": "/var/log/app.log", "topics": "app-logs"}

What is the expected behavior when this connector starts?
AIt reads the file '/var/log/app.log' and streams its contents to the 'app-logs' Kafka topic.
BIt writes data from the 'app-logs' Kafka topic into the file '/var/log/app.log'.
CIt creates a new Kafka topic named '/var/log/app.log'.
DIt fails to start due to missing 'tasks.max' configuration.
Step-by-Step Solution
Solution:
  1. Step 1: Identify connector type

    FileStreamSource is a source connector that reads from a file.
  2. Step 2: Understand data flow

    It reads the specified file and writes data into the Kafka topic.
  3. Step 3: Check configuration correctness

    All required fields are present; 'tasks.max' is set to 1 correctly.
  4. Final Answer:

    It reads the file '/var/log/app.log' and streams its contents to the 'app-logs' Kafka topic. -> Option A
  5. Quick Check:

    FileStreamSource reads file to topic [OK]
Quick Trick: FileStreamSource reads file into Kafka topic [OK]
Common Mistakes:
MISTAKES
  • Confusing source with sink connectors
  • Assuming it writes to file instead of reading
  • Misunderstanding 'tasks.max' role

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes