如何通过不同的 Confluent Registry 源忽略 Avro 模式?
How to ignore Avro schema by different Confluent Registry source?
我使用不同的 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 message-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"}
不可能在生产者中使用不同的注册表 url 并能够一致地使用它们。
原因是主题中会放置不同的ID。
无法跳过架构 ID 查找
如果您使用相同的注册表,则相同的架构有效负载将始终生成相同的 ID,然后消费者将能够始终如一地使用它来读取消息
我使用不同的 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 message-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"}
不可能在生产者中使用不同的注册表 url 并能够一致地使用它们。
原因是主题中会放置不同的ID。
无法跳过架构 ID 查找
如果您使用相同的注册表,则相同的架构有效负载将始终生成相同的 ID,然后消费者将能够始终如一地使用它来读取消息