我正在使用 MongoDB Source Connector 将数据从 MongoDB 集合获取到 Kafka。此连接器的作用是使用以下命名约定自动创建主题:
[prefix_provided_in_the_connector_properties].[db_name].[collection_name]
在 MongoDB Source Connector's documentation ,没有提及覆盖主题配置,例如分区数或复制因子。我有以下问题:
- Is it possible to override the topic configs in the connector.properties file?
- If not, is it then done on Kafka's end? If so, can we individually configure each topics' settings or it will globally affect all the topics?
谢谢!
最佳答案
听起来您的经纪人有 auto.create.topics.enable=true
。建议禁用此功能并强制执行手动主题创建。
Connect 仅为其自身创建内部主题。源连接器理想应该提前创建其主题,否则,您将获得broker server.properties
中设置的默认值。更改值不会更改现有主题
关于mongodb - 如何覆盖 MongoDB Source Connector 中的 Kafka Topic 配置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59798412/