我正在使用debezium mongo db源连接器。对于create/update来说效果很好,但是对于delete,我希望在targetdb中过滤完整的文档。为此,我将连接器配置为处理模式
"transforms.unwrap.delete.handling.mode" : "rewrite",
但它给出了错误(附截图)
"Caused by: java.lang.NullPointerException"
虽然我做的时候效果很好
"transforms.unwrap.delete.handling.mode" : "drop",
但在这种情况下,我得到null值。
我尝试了下面的transforms.unwrap.type,但得到了相同的结果
“transforms.unwrap.type”:“io.debezium.transforms.unwrapfromenvelope”,
“transforms.unwrap.type”:“io.debezium.connector.mongodb.transforms.unwrapfrommongodbenevelope”,
“transforms.unwrap.type”:“io.debezium.transforms.extractnewrecordstate”,
如果是delete而不是null,有什么方法可以得到完整的文档吗
请查看随附的错误截图和连接器的完整配置
{
"name": "inventory-mongo-connector",
"config": {
"connector.class" : "io.debezium.connector.mongodb.MongoDbConnector",
"tasks.max" : "1",
"mongodb.hosts" : "XXXXX",
"mongodb.name" : "YYYY",
"mongodb.user" : "ZZZZ",
"mongodb.password" : "TTTTT",
"database.whitelist" : "maindb",
"collection.whitelist":"maindb.collection1,maindb.collection2",
"database.history.kafka.bootstrap.servers" : "kafka:9092",
"transforms" : "unwrap",
"transforms.unwrap.type" : "io.debezium.transforms.UnwrapFromEnvelope",
"transforms.unwrap.drop.tombstones" : "false",
"transforms.unwrap.delete.handling.mode" : "rewrite",
"transforms.unwrap.operation.header" : "true"
}
}
暂无答案!
目前还没有任何答案,快来回答吧!