InsertField转换未应用于逻辑删除消息中。
我正在使用postgres 10.1 / debezium 1.2.1版本/ kafka 2.4.1版本
例如。
{
...
"transforms": "InsertField",
"transforms.InsertField.type": "org.apache.kafka.connect.transforms.InsertField$Key",
"transforms.InsertField.static.field": "__host",
"transforms.InsertField.static.value": "abc.com",
...
}
key - {"id":1, "__host": "abc.com"}, value - {"id":1, "__host": "abc.com", "col1": 1, "col2": "a"}
InsertField
转换)key - {"id":1, "__host": "abc.com"} value - {"id":1, "__host": "abc.com", "col1": null, "col2": null}
key - {"id":1} value - null
为什么会发生?是虫子吗?还是我错了?
答案 0 :(得分:1)
针对墓碑消息进行InsertField
转换的预期行为:
将插入键字段,并且该值保持为空。
但是在您的Kafka Connect版本(2.4.1)中,存在一个错误:未插入密钥字段。 它已在KAFKA-9707: InsertField.Key transformation should apply to tombstone records
中修复您可以将Kafka Connect群集升级到某个修复版本(例如2.4.2)。