提问者:小点点

kafka连接器转换器按主题名称检索架构


如果模式名称不遵循topicNameStrategy的模式,即-value连接器将抛出异常:

Caused by: org.apache.kafka.common.errors.SerializationException: Error retrieving Avro value schema version for id 11025
Caused by: io.confluent.kafka.schemaregistry.client.rest.exceptions.RestClientException: Subject not found. io.confluent.rest.exceptions.RestNotFoundException: Subject not found.
io.confluent.rest.exceptions.RestNotFoundException: Subject not found.
        at io.confluent.kafka.schemaregistry.rest.exceptions.Errors.subjectNotFoundException(Errors.java:51)
        at io.confluent.kafka.schemaregistry.rest.resources.SubjectsResource.lookUpSchemaUnderSubject(SubjectsResource.java:93)

查看模式注册表SubjectsResource.java中lookUpSchemaUnder主题的模式注册表代码,它表明客户端尝试按主题查找模式,并且subjectName由topicNameStrategy构造

为什么不ID全局ID每个版本每个模式都是唯一的?或者至少在找不到主题的情况下回退到ID?


共1个答案

匿名用户

一个可能的原因-全局ID没有跨记录兼容性的概念。这只是在主题版本的范围内定义的东西。

作为一种解决方法,您可以简单地拉取错误中列出的全局ID,然后将其作为所需的主题发布到注册表,然后重新启动连接器。

否则,如果数据已经是注册表中存在ID的字节,则不要使用除ByteArrayConverter之外的任何转换器。否则,例如,如果您使用AvroConverter,您最终会得到bytes的模式类型,而不是您的真实记录。