Scenario:
I’m using Kafka service in Aiven. I enabled Schema Registry API and created a schema. Then, I implemented producer and consumer in golang. I followed bellow steps basically.
Producer
-
Producer talks to the Schema Registry and checks whether the relevant schema is available.
-
If the producer can’t find the schema in the schema registry, it registers the new schema and cache it in the schema registry.
-
Then, the producer serializes the data with the schema and sends it to Kafka in binary format prepended with a unique schema ID.
Consumer
-
it will communicate with the schema registry using the schema ID it got from the producer and deserialize it using the same schema.
-
If there is a schema mismatch, the schema registry will throw an error.
I have few questions to clarify:
- Is what I have done is correct? Is that the proper way using the schema registries?
- Here, to get the schema from schema registry, I talked to an endpoint
https://{prefix}:14276/schemas/ids/{schemaId}
. But, there was no clue about this endpoint aiven docs (I think I didn’t miss). So, this questions me whether I have used the schema registries correctly. - General question: what is the schema registry used by Aiven?