使用最新的 kafka 和 confluence jdbc 接收器连接器。发送一条非常简单的 Json 消息:
{
"schema": {
"type": "struct",
"fields": [
{
"type": "int",
"optional": false,
"field": "id"
},
{
"type": "string",
"optional": true,
"field": "msg"
}
],
"optional": false,
"name": "msgschema"
},
"payload": {
"id": 222,
"msg": "hi"
}
}
但出现错误:
org.apache.kafka.connect.errors.DataException: JsonConverter with schemas.enable requires "schema" and "payload" fields and may not contain additional fields. If you are trying to deserialize plain JSON data, set schemas.enable=false in your converter configuration.
Jsonlint 表示 Json 有效。我保留了jsonschemas.enable=true
在卡夫卡配置中。有什么指点吗?
您需要告诉 Connect 您的架构is嵌入到您正在使用的 JSON 中。
你有:
value.converter=org.apache.kafka.connect.json.JsonConverter
但还需要:
value.converter.schemas.enable=true
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)