kafka sink to mongodb,如何将“\u id”字段设置为主题中某一列的现有值?

busg9geu  于 2021-06-04  发布在  Kafka
关注(0)|答案(0)|浏览(138)

我有以下由debezium生成的主题(json,而不是avro)
“payload”:{“id”:1,“name”:“test”:“uuid”:“f9a96ea4-3ff9-480f-bf8a-ee53a1e6e583”}
如何将“\u id”字段(在mongo集合中)设置为相同的值“uuid”?
这是我的Flume配置:

{
    "name": "mongo-sink",
    "config": {
        "connector.class": "com.mongodb.kafka.connect.MongoSinkConnector",
        "tasks.max": 3,
        "key.converter": "org.apache.kafka.connect.json.JsonConverter",
        "value.converter": "org.apache.kafka.connect.json.JsonConverter",
        "topics": "s4farm.animal",
        "connection.uri": "mongodb://user:password@host:port/?authSource=database",
        "database": "database",
        "collection": "s4farm_animal",
        "document.id.strategy": "com.mongodb.kafka.connect.sink.processor.id.strategy.PartialValueStrategy", 
        "value.projection.list": "id",
        "value.projection.type": "whitelist",
        "writemodel.strategy": "com.mongodb.kafka.connect.sink.writemodel.strategy.ReplaceOneBusinessKeyStrategy"
    }
}

你能帮助我吗?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题