Kafka Stream-正在注册的架构不兼容

时间:2020-09-19 07:33:42

标签: apache-kafka apache-kafka-streams confluent-schema-registry

我在kafka流中遇到架构注册表的奇怪问题,应用程序自1个月以来运行良好,并且源代码中没有架构更改,甚至我都检查了版本,请在下面找到错误。即使我已经更改了源主题名称,但仍然无法解决错误,兼容模式是向后,并且不能以任何方式更改。

我可以做一件事,但最好的办法就是更改应用程序ID(最后一个选项)

    Exception in thread "abc-StreamApp-0c417dc6-07e2-41fe-949f-4de801b2dd4e-StreamThread-1" org.apache.kafka.streams.errors.StreamsException: Exception caught in process. taskId=42_0, processor=KSTREAM-SOURCE-0000000353, topic=xyz, partition=0, offset=0, stacktrace=org.apache.kafka.common.errors.SerializationException: Error registering Avro schema: {"type":"record","name":"ABAuthorityMatrixDetail","namespace":"com.zand.models.avro","fields":[{"name":"ScenarioID","type":"int"},{"name":"CustomerID","type":["null","int"],"default":null},{"name":"aid","type":"int"},{"name":"sid","type":{"type":"int","connect.type":"int16"}},{"name":"FromAmount","type":["null","int"],"default":null},{"name":"ToAmount","type":["null","int"],"default":null},{"name":"CheckerGroupID","type":["null",{"type":"int","connect.type":"int16"}],"default":null},{"name":"sgid","type":{"type":"int","connect.type":"int16"}},{"name":"sgids","type":["null",{"type":"int","connect.type":"int16"}],"default":null},{"name":"sgid3","type":["null",{"type":"int","connect.type":"int16"}],"default":null},{"name":"sgid4","type":["null",{"type":"int","connect.type":"int16"}],"default":null},{"name":"ReleaserGroupID","type":["null",{"type":"int","connect.type":"int16"}],"default":null},{"name":"StatusID","type":["null",{"type":"int","connect.type":"int16"}],"default":null},{"name":"UserID","type":["null","int"],"default":null},{"name":"TransTime","type":["null",{"type":"long","connect.version":1,"connect.name":"io.debezium.time.Timestamp"}],"default":null},{"name":"AuthUserID","type":["null","int"],"default":null},{"name":"AuthTime","type":["null",{"type":"long","connect.version":1,"connect.name":"io.debezium.time.Timestamp"}],"default":null},{"name":"CancelUserID","type":["null","int"],"default":null},{"name":"CancelTime","type":["null",{"type":"long","connect.version":1,"connect.name":"io.debezium.time.Timestamp"}],"default":null},{"name":"CancelAuthUserID","type":["null","int"],"default":null},{"name":"CancelAuthTime","type":["null",{"type":"long","connect.version":1,"connect.name":"io.debezium.time.Timestamp"}],"default":null}],"connect.name":"com.abc.models.avro.xyz"}
Caused by: io.confluent.kafka.schemaregistry.client.rest.exceptions.RestClientException: Schema being registered is incompatible with an earlier schema; error code: 409
        at io.confluent.kafka.schemaregistry.client.rest.RestService.sendHttpRequest(RestService.java:226)
        at io.confluent.kafka.schemaregistry.client.rest.RestService.httpRequest(RestService.java:252)
        at io.confluent.kafka.schemaregistry.client.rest.RestService.registerSchema(RestService.java:352)
        at io.confluent.kafka.schemaregistry.client.rest.RestService.registerSchema(RestService.java:344)
        at io.confluent.kafka.schemaregistry.client.rest.RestService.registerSchema(RestService.java:330)
        at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.registerAndGetId(CachedSchemaRegistryClient.java:142)
        at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.register(CachedSchemaRegistryClient.java:196)
        at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.register(CachedSchemaRegistryClient.java:172)
        at io.confluent.kafka.serializers.AbstractKafkaAvroSerializer.serializeImpl(AbstractKafkaAvroSerializer.java:79)
        at io.confluent.kafka.serializers.KafkaAvroSerializer.serialize(KafkaAvroSerializer.java:53)
        at io.confluent.kafka.streams.serdes.avro.SpecificAvroSerializer.serialize(SpecificAvroSerializer.java:65)
        at io.confluent.kafka.streams.serdes.avro.SpecificAvroSerializer.serialize(SpecificAvroSerializer.java:38)
        at org.apache.kafka.common.serialization.Serializer.serialize(Serializer.java:62)
        at org.apache.kafka.streams.processor.internals.RecordCollectorImpl.send(RecordCollectorImpl.java:162)
        at org.apache.kafka.streams.processor.internals.RecordCollectorImpl.send(RecordCollectorImpl.java:102)
        at org.apache.kafka.streams.processor.internals.SinkNode.process(SinkNode.java:89)
        at org.apache.kafka.streams.processor.internals.ProcessorContextImpl.forward(ProcessorContextImpl.java:201)
        at org.apache.kafka.streams.processor.internals.ProcessorContextImpl.forward(ProcessorContextImpl.java:180)
        at org.apache.kafka.streams.processor.internals.ProcessorContextImpl.forward(ProcessorContextImpl.java:133)
        at org.apache.kafka.streams.kstream.internals.KStreamFilter$KStreamFilterProcessor.process(KStreamFilter.java:43)
        at org.apache.kafka.streams.processor.internals.ProcessorNode.process(ProcessorNode.java:117)
        at org.apache.kafka.streams.processor.internals.ProcessorContextImpl.forward(ProcessorContextImpl.java:201)
        at org.apache.kafka.streams.processor.internals.ProcessorContextImpl.forward(ProcessorContextImpl.java:180)
        at org.apache.kafka.streams.processor.internals.ProcessorContextImpl.forward(ProcessorContextImpl.java:133)
        at org.apache.kafka.streams.kstream.internals.KStreamMap$KStreamMapProcessor.process(KStreamMap.java:42)
        at org.apache.kafka.streams.processor.internals.ProcessorNode.process(ProcessorNode.java:117)
        at org.apache.kafka.streams.processor.internals.ProcessorContextImpl.forward(ProcessorContextImpl.java:201)
        at org.apache.kafka.streams.processor.internals.ProcessorContextImpl.forward(ProcessorContextImpl.java:180)
        at org.apache.kafka.streams.processor.internals.ProcessorContextImpl.forward(ProcessorContextImpl.java:133)
        at org.apache.kafka.streams.processor.internals.SourceNode.process(SourceNode.java:87)
        at org.apache.kafka.streams.processor.internals.StreamTask.process(StreamTask.java:366)
        at org.apache.kafka.streams.processor.internals.AssignedStreamsTasks.process(AssignedStreamsTasks.java:199)
        at org.apache.kafka.streams.processor.internals.TaskManager.process(TaskManager.java:420)
        at org.apache.kafka.streams.processor.internals.StreamThread.runOnce(StreamThread.java:890)
        at org.apache.kafka.streams.processor.internals.StreamThread.runLoop(StreamThread.java:805)
        at org.apache.kafka.streams.processor.internals.StreamThread.run(StreamThread.java:774)

        at org.apache.kafka.streams.processor.internals.StreamTask.process(StreamTask.java:383)
        at org.apache.kafka.streams.processor.internals.AssignedStreamsTasks.process(AssignedStreamsTasks.java:199)
        at org.apache.kafka.streams.processor.internals.TaskManager.process(TaskManager.java:420)
        at org.apache.kafka.streams.processor.internals.StreamThread.runOnce(StreamThread.java:890)
        at org.apache.kafka.streams.processor.internals.StreamThread.runLoop(StreamThread.java:805)
        at org.apache.kafka.streams.processor.internals.StreamThread.run(StreamThread.java:774)
Caused by: org.apache.kafka.common.errors.SerializationException: Error registering Avro schema: {"type":"record","name":"xyz","namespace":"com.abc.models.avro","fields":[{"name":"ScenarioID","type":"int"},{"name":"CustomerID","type":["null","int"],"default":null},{"name":"AuthorityMatrixID","type":"int"},{"name":"sid","type":{"type":"int","connect.type":"int16"}},{"name":"FromAmount","type":["null","int"],"default":null},{"name":"ToAmount","type":["null","int"],"default":null},{"name":"CheckerGroupID","type":["null",{"type":"int","connect.type":"int16"}],"default":null},{"name":"sgid","type":{"type":"int","connect.type":"int16"}},{"name":"sgids","type":["null",{"type":"int","connect.type":"int16"}],"default":null},{"name":"sgid3","type":["null",{"type":"int","connect.type":"int16"}],"default":null},{"name":"sgid4","type":["null",{"type":"int","connect.type":"int16"}],"default":null},{"name":"ReleaserGroupID","type":["null",{"type":"int","connect.type":"int16"}],"default":null},{"name":"StatusID","type":["null",{"type":"int","connect.type":"int16"}],"default":null},{"name":"UserID","type":["null","int"],"default":null},{"name":"TransTime","type":["null",{"type":"long","connect.version":1,"connect.name":"io.debezium.time.Timestamp"}],"default":null},{"name":"AuthUserID","type":["null","int"],"default":null},{"name":"AuthTime","type":["null",{"type":"long","connect.version":1,"connect.name":"io.debezium.time.Timestamp"}],"default":null},{"name":"CancelUserID","type":["null","int"],"default":null},{"name":"CancelTime","type":["null",{"type":"long","connect.version":1,"connect.name":"io.debezium.time.Timestamp"}],"default":null},{"name":"CancelAuthUserID","type":["null","int"],"default":null},{"name":"CancelAuthTime","type":["null",{"type":"long","connect.version":1,"connect.name":"io.debezium.time.Timestamp"}],"default":null}],"connect.name":"com.abc.models.avro.xyz"}
Caused by: io.confluent.kafka.schemaregistry.client.rest.exceptions.RestClientException: Schema being registered is incompatible with an earlier schema; error code: 409
        at io.confluent.kafka.schemaregistry.client.rest.RestService.sendHttpRequest(RestService.java:226)
        at io.confluent.kafka.schemaregistry.client.rest.RestService.httpRequest(RestService.java:252)
        at io.confluent.kafka.schemaregistry.client.rest.RestService.registerSchema(RestService.java:352)
        at io.confluent.kafka.schemaregistry.client.rest.RestService.registerSchema(RestService.java:344)
        at io.confluent.kafka.schemaregistry.client.rest.RestService.registerSchema(RestService.java:330)
        at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.registerAndGetId(CachedSchemaRegistryClient.java:142)
        at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.register(CachedSchemaRegistryClient.java:196)
        at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.register(CachedSchemaRegistryClient.java:172)
        at io.confluent.kafka.serializers.AbstractKafkaAvroSerializer.serializeImpl(AbstractKafkaAvroSerializer.java:79)
        at io.confluent.kafka.serializers.KafkaAvroSerializer.serialize(KafkaAvroSerializer.java:53)
        at io.confluent.kafka.streams.serdes.avro.SpecificAvroSerializer.serialize(SpecificAvroSerializer.java:65)
        at io.confluent.kafka.streams.serdes.avro.SpecificAvroSerializer.serialize(SpecificAvroSerializer.java:38)
        at org.apache.kafka.common.serialization.Serializer.serialize(Serializer.java:62)
        at org.apache.kafka.streams.processor.internals.RecordCollectorImpl.send(RecordCollectorImpl.java:162)
        at org.apache.kafka.streams.processor.internals.RecordCollectorImpl.send(RecordCollectorImpl.java:102)
        at org.apache.kafka.streams.processor.internals.SinkNode.process(SinkNode.java:89)
        at org.apache.kafka.streams.processor.internals.ProcessorContextImpl.forward(ProcessorContextImpl.java:201)
        at org.apache.kafka.streams.processor.internals.ProcessorContextImpl.forward(ProcessorContextImpl.java:180)
        at org.apache.kafka.streams.processor.internals.ProcessorContextImpl.forward(ProcessorContextImpl.java:133)
        at org.apache.kafka.streams.kstream.internals.KStreamFilter$KStreamFilterProcessor.process(KStreamFilter.java:43)
        at org.apache.kafka.streams.processor.internals.ProcessorNode.process(ProcessorNode.java:117)
        at org.apache.kafka.streams.processor.internals.ProcessorContextImpl.forward(ProcessorContextImpl.java:201)
        at org.apache.kafka.streams.processor.internals.ProcessorContextImpl.forward(ProcessorContextImpl.java:180)
        at org.apache.kafka.streams.processor.internals.ProcessorContextImpl.forward(ProcessorContextImpl.java:133)
        at org.apache.kafka.streams.kstream.internals.KStreamMap$KStreamMapProcessor.process(KStreamMap.java:42)
        at org.apache.kafka.streams.processor.internals.ProcessorNode.process(ProcessorNode.java:117)
        at org.apache.kafka.streams.processor.internals.ProcessorContextImpl.forward(ProcessorContextImpl.java:201)
        at org.apache.kafka.streams.processor.internals.ProcessorContextImpl.forward(ProcessorContextImpl.java:180)
        at org.apache.kafka.streams.processor.internals.ProcessorContextImpl.forward(ProcessorContextImpl.java:133)
        at org.apache.kafka.streams.processor.internals.SourceNode.process(SourceNode.java:87)
        at org.apache.kafka.streams.processor.internals.StreamTask.process(StreamTask.java:366)
        at org.apache.kafka.streams.processor.internals.AssignedStreamsTasks.process(AssignedStreamsTasks.java:199)
        at org.apache.kafka.streams.processor.internals.TaskManager.process(TaskManager.java:420)
        at org.apache.kafka.streams.processor.internals.StreamThread.runOnce(StreamThread.java:890)
        at org.apache.kafka.streams.processor.internals.StreamThread.runLoop(StreamThread.java:805)
        at org.apache.kafka.streams.processor.internals.StreamThread.run(StreamThread.java:774)

0 个答案:

没有答案