使用MongoDB接收器连接器通过不同的主键更新现有文档



我正试图通过Confluent Cloud设置一个MongoDB接收器连接器,它可以在pgsql和MongoDB之间保持数据同步。

我希望下面的配置基于id(int(字段(而不是_id-objectId(更新现有文档,但它只是在使用时在MongoDB中创建一个新文档。pg中的文档将不包含_id字段,因此我们需要在我们的pgsql主键(id(上进行查找。

有什么想法为什么这没有像我预期的那样奏效吗?

{
"connector.class": "MongoDbAtlasSink",
"name": "mongodb-sink",
"kafka.api.key": "mykey",
"kafka.api.secret": "mysecret",
"input.data.format": "JSON",
"topics":"mytopic",
"connection.host": "myhost",
"connection.user": "myuser",
"connection.password": "mypassword",
"database": "mydatabase",
"delete.on.null.values": "false",
"tasks.max": "1",
"document.id.strategy": "com.mongodb.kafka.connect.sink.processor.id.strategy.PartialValueStrategy",
"document.id.strategy.partial.value.projection.list":"id",
"document.id.strategy.partial.value.projection.type":"AllowList",
"writemodel.strategy":"com.mongodb.kafka.connect.sink.writemodel.strategy.ReplaceOneBusinessKeyStrategy"
}

key.projection.typevalue.projection.type在云版本中显然不受支持,因此无法使用该配置。

云连接器限制

最新更新