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

输出格式属性

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

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

名称
说明

output.format.key

类型:字符串


描述:指定源Connector输出密钥文档的数据格式。默认值:

json
接受的值:bsonjsonschema

output.format.value

类型:字符串


描述:指定源Connector输出值文档的数据格式。Connector支持

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

json
接受的值:bsonjsonschema

output.json.formatter

类型:字符串


描述:Connector用于输出数据的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

类型:字符串

描述:为
SourceRecord 的密钥文档指定 Avro模式定义。要学习;了解有关

Avro模式的更多信息,请参阅数据格式指南中的 Avro。默认值:

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

接受值:有效的 Avro模式

output.schema.value

类型:字符串

描述:为
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

类型:布尔值 描述:Connector是否应推断


SourceRecord 的值文档的模式。由于Connector隔离性处理每个文档,因此Connector可能会生成许多模式。重要提示:仅当您设立

output.format.value设置为 时,Connector才会读取此设置。默认值:schema

false
接受的值:truefalse

在此页面上