MongoDB 中的主题字段
Fields to topic from MongoDB
我想 运行 使用 Mongo 中的必填字段将 Kafka 连接作为源,而不是将整个 collection 拉到一起。这可能吗?
例如:我有 collection
{ contact_name: "Ace Farad", contact_uid: "HdeofVad" }
但是对于主题我只需要发送 contact_name。谢谢!
使用转换删除字段
"transforms": "ReplaceField",
"transforms.ReplaceField.type": "org.apache.kafka.connect.transforms.ReplaceField$Value",
"transforms.ReplaceField.blacklist": "contact_uid"
https://docs.confluent.io/platform/current/connect/transforms/replacefield.html
注意:这可能仅适用于顶级字段,不适用于嵌套集合
另一种方法是将所有数据读入“原始”主题,然后在 Kafka 中按照您想要的方式对其进行操作
我想 运行 使用 Mongo 中的必填字段将 Kafka 连接作为源,而不是将整个 collection 拉到一起。这可能吗? 例如:我有 collection
{ contact_name: "Ace Farad", contact_uid: "HdeofVad" }
但是对于主题我只需要发送 contact_name。谢谢!
使用转换删除字段
"transforms": "ReplaceField",
"transforms.ReplaceField.type": "org.apache.kafka.connect.transforms.ReplaceField$Value",
"transforms.ReplaceField.blacklist": "contact_uid"
https://docs.confluent.io/platform/current/connect/transforms/replacefield.html
注意:这可能仅适用于顶级字段,不适用于嵌套集合
另一种方法是将所有数据读入“原始”主题,然后在 Kafka 中按照您想要的方式对其进行操作