此版本的文档已存档,不再提供支持。查看 当前文档,了解如何升级您的 Kafka Connector 版本。
Overview
重要
copy.existing* 属性已弃用
从 MongoDB Kafka Connector 的1.9版本开始, copy.existing*属性已弃用,可能会在未来版本中删除。 您应使用startup.mode*属性来配置复制现有功能。 要了解startup.mode*设置,请参阅启动属性。
使用以下配置设置启用复制现有功能,从而将 MongoDB collection 转换为 change stream 事件。
提示
有关复制现有功能的示例,请参阅复制现有数据使用示例。
有关按类别排列的 Source 连接器配置设置列表,请参阅 Source 连接器配置属性指南。
设置
名称 | 说明 | |
|---|---|---|
copy.existing | Type: boolean Description: Whether to enable the copy existing feature which converts all
data in a MongoDB collection to Change Stream events and
publishes them on Kafka topics. If MongoDB changes the source
collection data after the connector starts the copy process, the
connector creates events for the changes after it completes the copy
process. 如果任何系统在 Source 连接器从数据库转换现有数据时更改数据库中的数据,MongoDB 可能会生成重复的变更流事件以反映最新更改。由于数据复制所依赖的变更流事件是幂等的,因此复制的数据最终是一致的。 Default: falseAccepted Values: true or false | |
copy.existing.namespace.regex | Type: string Description: Regular expression the connector uses to match namespaces from
which to copy data. A namespace describes the MongoDB database name
and collection separated by a period (for example, databaseName.collectionName).例子在下例中,正则表达式设置与 The "" character in the example above escapes the "." character that follows it in the regular expression. For more information on how to build regular expressions, see the Java API documentation on Patterns. Default: ""Accepted Values: A valid regular expression | |
copy.existing.pipeline | Type: string Description: An array of pipeline operations
the connector runs when copying existing data. You can use this
setting to filter the source collection and improve the use of
indexes in the copying process. 例子以下示例展示如何使用$match聚合操作符指示connector仅复制包含值为 Default: []Accepted Values: Valid aggregation pipeline stages | |
copy.existing.max.threads | Type: int Description: The maximum number of threads the connector can use to copy data. Default: number of processors available in the environment Accepted Values: An integer | |
copy.existing.queue.size | Type: int Description: The size of the queue the connector can use when copying data. Default: 16000Accepted Values: An integer | |
copy.existing.allow.disk.use | Type: boolean Description: When set to true, the connector uses temporary disk storage
for the copy existing aggregation.Default: true |