Search code examples
javaapache-kafkaavroconfluent-schema-registry

How to register schema in the schema-registry based on input ID


By default AVRO schema registers to schema-registry and giving a randomly generated ID.

My requirement is that it generates the ID provided in the request. I have been going through the schema-registry source code and realized that they have not exposed any API for that.

Is my understanding correct? If not, please help me with REST API.


Solution

  • If I understand correctly, you want Schema Registry register the Schema with the id you passed in the request.

    Schema Registry does not expose any API for this purposed to be called from clients, it assigns globals unique id to each registered schema, which are guaranteed to be monotonically increasing but not necessarily consecutive.

    On Design Overview section explains this.