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

输出格式属性

使用以下配置设置指定 MongoDB Kafka Source 连接器发布到 Kafka 主题的数据格式。

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

名称
说明

output.format.key

类型:string

说明:
指定源连接器输出键文档的数据格式。

默认:json
接受的值:bson、json、schema

output.format.value

类型:string

说明:
指定源连接器将值文档输出为哪种数据格式。

连接器支持 Protobuf 作为输出数据格式。您可以通过指定 schema 值并安装和配置 Kafka Connect Protobuf 转换器来启用此格式。

默认:json
接受的值:bson、json、schema

output.json.formatter

类型:string

说明:
连接器用于输出数据的 JSON 格式化程序的类名称。

默认:

com.mongodb.kafka.connect.source.json.formatter.DefaultJson

可接受值:
您的自定义 JSON 格式化程序完整类名或以下内置格式化程序类名之一:

com.mongodb.kafka.connect.source.json.formatter.DefaultJson
com.mongodb.kafka.connect.source.json.formatter.ExtendedJson
com.mongodb.kafka.connect.source.json.formatter.SimplifiedJson

要了解有关这些输出格式的更多信息,请参阅 JSON 格式化程序。

output.schema.key

类型:string

说明:
为 SourceRecord 的键文档指定 Avro 模式定义。

要了解关于 Avro 模式的更多信息,请参阅 数据格式指南 中的 Avro 。

默认:

{
"type": "record",
"name": "keySchema",
"fields" : [ { "name": "_id", "type": "string" } ]"
}

接受值:有效的 AVRO 模式

output.schema.value

类型:string

说明:
为 SourceRecord 的值文档指定 AVRO 模式定义。

要了解关于 Avro 模式的更多信息,请参阅 数据格式指南 中的 Avro 。

默认:

{
"name": "ChangeStream",
"type": "record",
"fields": [
{ "name": "_id", "type": "string" },
{ "name": "operationType", "type": ["string", "null"] },
{ "name": "fullDocument", "type": ["string", "null"] },
{ "name": "ns",
"type": [{"name": "ns", "type": "record", "fields": [
{"name": "db", "type": "string"},
{"name": "coll", "type": ["string", "null"] } ]
}, "null" ] },
{ "name": "to",
"type": [{"name": "to", "type": "record", "fields": [
{"name": "db", "type": "string"},
{"name": "coll", "type": ["string", "null"] } ]
}, "null" ] },
{ "name": "documentKey", "type": ["string", "null"] },
{ "name": "updateDescription",
"type": [{"name": "updateDescription", "type": "record", "fields": [
{"name": "updatedFields", "type": ["string", "null"]},
{"name": "removedFields",
"type": [{"type": "array", "items": "string"}, "null"]
}] }, "null"] },
{ "name": "clusterTime", "type": ["string", "null"] },
{ "name": "txnNumber", "type": ["long", "null"]},
{ "name": "lsid", "type": [{"name": "lsid", "type": "record",
"fields": [ {"name": "id", "type": "string"},
{"name": "uid", "type": "string"}] }, "null"] }
]
}

接受值:有效的 JSON schema

output.schema.infer.value

类型:布尔值

说明:
连接器是否应推理出 SourceRecord 值文档的模式。由于连接器以隔离性处理每个文档,因此连接器可能会生成许多模式。

重要:仅当您将 output.format.value 设置设置为 schema 时,连接器才会读取此设置。

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

给本页内容打分

在此页面上