对于 AI 代理:可在 https://www.mongodb.com/zh-cn/docs/llms.txt 获取文档索引—通过在任何 URL 路径后添加 .md 可获取所有页面的 Markdown 版本。
Docs 菜单

启动属性

使用以下配置设置来配置 MongoDB Kafka Source 连接器的启动,以将 MongoDB 集合转换为变更流事件。

提示

有关使用复制现有功能的示例,请参阅复制现有数据用法示例。

有关按类别排列的 Source 连接器配置设置列表,请参阅 Source 连接器配置属性指南。

名称
说明

startup.mode

类型: string

说明:
指定当没有可用的源偏移时,连接器应如何启动。恢复变更流需要恢复令牌,连接器将从源偏移获取该令牌。如果没有可用的源偏移,则连接器可能会忽略全部或部分现有源数据,或者可能会先复制所有现有源数据,然后继续处理新数据。

如果为 startup.mode=latest,连接器会忽略所有现有源数据。

如果为 startup.mode=timestamp,连接器将激活 startup.mode.timestamp.* 属性。如果未配置属性,timestamp 等同于 latest 。

如果 startup.mode=copy_existing,连接器会将所有现有源数据复制到变更流事件。此设置相当于已弃用的设置 copy.existing=true。

如果任何系统在源Connector从数据库转换现有数据时更改数据库中的数据, MongoDB可能会生成重复的变更流事件以反映最新更改。由于数据复制所依赖的变更流事件是幂等的,因此复制的数据最终是一致的,符合“至少一次”交付保证。

默认:latest
接受的值:latest、timestamp、copy_existing

startup.mode.timestamp.start.at.operation.time

Type: string

Description:
Actuated only if startup.mode=timestamp. Specifies the starting point for the change stream.

To learn more about Change Stream parameters, see $changeStream (aggregation) in the MongoDB manual.

Default: ""
Accepted Values:

  • 自纪元以来的整数秒数(十进制格式)(例如,30)

  • ISO-8601 格式的瞬间,精度为一秒(例如,1970-01-01T00:00:30Z)

  • 规范扩展 JSON (v2) 格式的 BSON 时间戳(例如 {"$timestamp": {"t": 30, "i": 0}})

startup.mode.copy.existing.namespace.regex

类型: string

说明:
连接器用于匹配要从中复制数据的命名空间的正则表达式。命名空间描述由句点分隔的 MongoDB 数据库名称和集合(示例,databaseName.collectionName)。

示例,以下正则表达式设置与 stats 数据库中以“page”开头的集合相匹配:

startup.mode.copy.existing.namespace.regex=stats\.page.*

上述示例中的 \ 字符转义了正则表达式中紧随其后的 . 字符。有关如何构建正则表达式的更多信息,请参阅 Java API 文档中有关模式的内容。

默认:""
接受的值:有效的正则表达式

startup.mode.copy.existing.pipeline

Type: string

Description:
An inline 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.

For example, the following setting uses the $match aggregation operator to instruct the connector to copy only documents that contain a closed field with a value of false.

startup.mode.copy.existing.pipeline=[ { "$match": { "closed": "false" } } ]

默认:""
接受值:有效的聚合管道阶段

startup.mode.copy.existing.max.threads

类型:int

说明:
连接器可用于复制数据的最大线程数。

默认值:环境中可用的处理器数量
接受的值:整数

startup.mode.copy.existing.queue.size

类型:int

说明:
连接器在复制数据时可以使用的队列大小。

默认:16000
接受值:整数

startup.mode.copy.existing.allow.disk.use

类型: 布尔值

说明:
当设置为 true 时,连接器会为复制现有聚合使用临时磁盘存储。

默认: true
可接受值: true 或 false

给本页内容打分

在此页面上