【发布时间】:2020-04-26 17:01:44
【问题描述】:
我为一个主题使用不同的 Confluent Registry 源生成相同的 Avro 架构。使用此主题时出现错误:
org.apache.kafka.common.errors.SerializationException: Error deserializing key/value for partition XXXXX_XXXX_XXX-0 at offset 0. If needed, please seek past the record to continue consumption.
Caused by: org.apache.kafka.common.errors.SerializationException: Error deserializing Avro message for id 7
Caused by: org.apache.kafka.common.errors.SerializationException: Could not find class XXXXX_XXXX_XXX specified in writer's schema whilst finding reader's schema for a SpecificRecord.
如何忽略不同的 Avro 消息 ID?
架构:
{
"type": "record",
"name": "XXXXX_XXXX_XXX",
"namespace": "aa.bb.cc.dd",
"fields": [
{
"name": "ACTION",
"type": [
"null",
"string"
],
"default":null,
"doc":"action"
},
{
"name": "EMAIL",
"type": [
"null",
"string"
],
"default":null,
"doc":"email address"
}
]
}
产生的命令
{"Action": "A", "EMAIL": "xxxx@xxx.com"}
【问题讨论】:
-
您能否分享为该主题生成和使用数据的架构和命令?
标签: java apache-kafka avro confluent-schema-registry