是否有人已经使用了mongodb的官方mongodb接收器连接器?我尝试使用map remapper后处理器重命名字段,但失败了,目标集合中没有写入任何内容。到目前为止,连接错误日志中没有错误。没有线索。以下是我的连接器的配置:
{
"value.converter.schema.registry.url": "http://schema-registry:8081",
"transforms.WrapKey.field": "_id",
"transforms.WrapKey.type": "org.apache.kafka.connect.transforms.HoistField$Key",
"name": "mongoDBSink_DbArtists3",
"connector.class": "com.mongodb.kafka.connect.MongoSinkConnector",
"key.converter": "org.apache.kafka.connect.storage.StringConverter",
"value.converter": "io.confluent.connect.avro.AvroConverter",
"transforms": [
"WrapKey"
],
"topics": [
"STR02VWARTISTS"
],
"connection.uri": "mongodb://db:password@mongodb:27017/db?authSource=admin",
"database": "db",
"collection": "dbArtists3",
"post.processor.chain": [
"com.mongodb.kafka.connect.sink.processor.DocumentIdAdder",
"com.mongodb.kafka.connect.sink.processor.field.renaming.RenameByMapping"
],
"field.renamer.mapping": "[{\"oldName\":\"key.COUNTRYNAME\",\"newName\":\"CountryName\"},{\"oldName\":\"key.COUNTRYCODE\",\"newName\":\"CountryCode\"},{\"oldName\":\"key.IDALBUMS\",\"newName\":\"IDAlbums\"},{\"oldName\":\"key.GENRE\",\"newName\":\"Genre\"}]",
"document.id.strategy": "com.mongodb.kafka.connect.sink.processor.id.strategy.ProvidedInKeyStrategy"
}
请确认谁能帮忙,谢谢。
暂无答案!
目前还没有任何答案,快来回答吧!