Kafka - ConnectYou 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.Check Answer
Step-by-Step SolutionSolution:Step 1: Understand sink connector file routingFileStreamSinkConnector writes to one file per connector instance.Step 2: Select best way to write to multiple files by topicCreating one connector per topic with separate file paths is best practice.Final Answer:Create one connector per topic, each with its own "file" property. -> Option DQuick Check:One connector per output file for topic-based routing [OK]Quick Trick: Use multiple connectors to write topic-based files [OK]Common Mistakes:MISTAKESAssuming one connector can write to multiple files automaticallyMisusing tasks.max for file routingSetting file to a directory path instead of a file
Master "Connect" in Kafka9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More Kafka Quizzes Kafka Connect - Transform and converter chains - Quiz 5medium Kafka Connect - Transform and converter chains - Quiz 9hard Kafka Connect - Standalone vs distributed mode - Quiz 12easy Kafka Connect - Source connectors - Quiz 2easy Kafka Streams - Windowed operations - Quiz 11easy Kafka with Java/Python - Python consumer - Quiz 7medium Message Delivery Semantics - At-least-once delivery - Quiz 12easy Monitoring and Operations - Key broker metrics - Quiz 9hard Monitoring and Operations - Kafka Manager/UI tools - Quiz 12easy Schema Registry - Why schema management prevents data issues - Quiz 3easy