2
votes

I am new to Avro and Kafka. From my understanding of avro, all avro records would have a schema attached to it. The kafka producer converts the data into byte array and sends it to kafka consumer. The consumer returns the data sent. My question is how do I retrieve the schema from kafka consumer without bringing in the concept of schema registry. Is there a way to get the schema back from kafka consumer without using schema registry?

2

2 Answers

1
votes

No, your kakfa message serialized in avro only contains a schema id. This id is used to retrieve the good schema on schema registry.

1
votes

Avro Records will have schemaId attached with them at the time of Avro encoding. This schema Id is the identifier for fetching the schema that has been used for encoding.As the same schema is used at the time of decoding as well. So basically you can get the SchemaId from the record and then you can get the corresponding schema for that id from schema registry but not from the record itself.