Bird
Raised Fist0

You want to export data from multiple Kafka topics to a single database table using a JDBC sink connector. Which configuration approach is correct?

hard🚀 Application Q15 of Q15
Kafka - Connect

You want to export data from multiple Kafka topics to a single database table using a JDBC sink connector. Which configuration approach is correct?

{
  "name": "multi-topic-jdbc-sink",
  "config": {
    "connector.class": "io.confluent.connect.jdbc.JdbcSinkConnector",
    "topics": "topic1,topic2,topic3",
    "connection.url": "jdbc:mysql://localhost:3306/mydb",
    "table.name.format": "combined_table"
  }
}
AThis config exports all topics to one table named 'combined_table'
BEach topic will create a separate table ignoring 'table.name.format'
CThe connector will fail because multiple topics are not allowed
DData will be merged but only from 'topic1'
Step-by-Step Solution
Solution:
  1. Step 1: Understand 'topics' field with multiple topics

    The "topics" field lists multiple topics separated by commas, which is valid.
  2. Step 2: Check 'table.name.format' usage

    Setting "table.name.format" to a fixed table name causes all data to go into that single table.
  3. Step 3: Confirm connector behavior

    The JDBC sink connector supports writing multiple topics to one table if configured this way.
  4. Final Answer:

    This config exports all topics to one table named 'combined_table' -> Option A
  5. Quick Check:

    Multiple topics + fixed table name = single table export [OK]
Quick Trick: Use comma-separated topics and fixed table name for single table export [OK]
Common Mistakes:
MISTAKES
  • Assuming multiple topics create separate tables automatically
  • Thinking multiple topics are not allowed in sink config
  • Ignoring 'table.name.format' effect

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes