Replies: 1 comment 8 replies
-
No, it will not error, as it is a common use case to only unmarshal part of a schema in to a struct. As you must provide the schema and object to unmarshal the data, it is assumed you have paired the 2 correctly. Further it should be noted that with Avro there is no way from the data itself to know if the schema and data match, this must be tracked by the user. The most common way of doing this on Kafka is to use a Confluent Schema Registry and their wire format. |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi team, I want to understand the working of Unmarshal. I have two similar Go structs Cat and Dog but with different avro tags.
If I am not wrong then unmarshalling a Cat serialised message into a Dog obj should return me an error.
Like here errUnmarshal should not be non nil, but I am not getting any error. Please help me understand this behaviour. Or more like how to identify the kafka messages if they are of Dog type or Cat type
Beta Was this translation helpful? Give feedback.
All reactions