Bird
Raised Fist0

You want to configure a sink connector to write data to different files based on the Kafka topic name. Which configuration strategy is best?

hard🚀 Application Q9 of Q15
Kafka - Connect
You want to configure a sink connector to write data to different files based on the Kafka topic name. Which configuration strategy is best?
AUse a single connector with a custom converter that routes data to files.
BSet "topics" to all topics and "file" to a directory path.
CUse "tasks.max" equal to the number of topics to split files automatically.
DCreate one connector per topic, each with its own "file" property.
Step-by-Step Solution
Solution:
  1. Step 1: Understand sink connector file routing

    FileStreamSinkConnector writes to one file per connector instance.
  2. Step 2: Select best way to write to multiple files by topic

    Creating one connector per topic with separate file paths is best practice.
  3. Final Answer:

    Create one connector per topic, each with its own "file" property. -> Option D
  4. Quick Check:

    One connector per output file for topic-based routing [OK]
Quick Trick: Use multiple connectors to write topic-based files [OK]
Common Mistakes:
MISTAKES
  • Assuming one connector can write to multiple files automatically
  • Misusing tasks.max for file routing
  • Setting file to a directory path instead of a file

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes