[英]Unable to deserialize Avro message using Confluent Schema Registry and Spring Cloud Stream
I am using Spring Cloud Stream and Confluent Schema Registry to register Avro schemas. 我正在使用Spring Cloud Stream和Confluent Schema Registry注册Avro架构。
Schemas are registered successfully. 模式已成功注册。 But when my Stream Listener receives a message the payload is still in Bytes.
但是,当我的流侦听器收到消息时,有效负载仍以字节为单位。
Here are my properties. 这是我的财产。
spring.cloud.stream.schemaRegistryClient.endpoint=http://localhost:8081 spring.cloud.stream.bindings.output.contentType=application/*+avro spring.cloud.stream.schema.avro.dynamic-schema-generation-enabled=true spring.cloud.stream.schemaRegistryClient.cached=true spring.cloud.stream.schema.avro.schemaLocations=classpath*:schemas/*.avsc spring.cloud.stream.bindings.input.contentType=application/*+avro
While receiving message I noticed that " convertFromInternal " in " AbstractAvroMessageConverter " never gets invoked which is suppose to decode the message. 当接收消息我注意到,“convertFromInternal”中的“AbstractAvroMessageConverter”永远不会被调用这是假设解码消息。
What version of SCSt are you using? 您正在使用哪个版本的SCSt? We fixed a couple of issues when integrating with confluent schema registry server on 1.3.
与1.3上的融合架构注册表服务器集成时,我们修复了几个问题。
Also, you don't need to set the input contentType, resolution happens via headers that contain application/vnd*+avro
that's the hint for the converter to kick in and find the correct schema from the server. 另外,您无需设置输入contentType,解析通过包含
application/vnd*+avro
标头进行,这是转换器启动并从服务器中查找正确架构的提示。 You only set that contentType on the output channels, it gets replaced with the correct version for example: application/vnd.user.v1+avro
您只需在输出通道上设置该contentType,它就会替换为正确的版本,例如:
application/vnd.user.v1+avro
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.