You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/07/12 03:22:33 UTC

[GitHub] [rocketmq-schema-registry] MatrixHB opened a new issue, #2: SchemaController optimize

MatrixHB opened a new issue, #2:
URL: https://github.com/apache/rocketmq-schema-registry/issues/2

   1、schemaID
   ![image](https://user-images.githubusercontent.com/23614576/178401496-e04c411e-938e-4ad1-b49b-3ea32fdda81a.png)
   When I evolve the schema, I found the version change but the schemaId is still the same. I think it's better to increase the schemaId while the version evolves, so that when producer send a message with schema, it can guide the consumer to obtain a specified version of schema by passing schemaID.
   
   2、error code
   ![image](https://user-images.githubusercontent.com/23614576/178401560-1e4ebc51-7297-4007-a3e5-ca4974565bbb.png)
   When I evolve the schema and the compatibility validation failed, the response is "500, Internal Server Error". It's not suitable because validation error is expectable exception and should have customized new error code.
   Other error, like "Schema is already exist" also have the same problem.
   ![image](https://user-images.githubusercontent.com/23614576/178401599-c8f5e878-b30d-4a1d-8c7d-2ae3598f2544.png)
   
   3、more method to get schema
   The REST interface to obtain schema in SchemaController is not comprehensive enough. Now we only have getSchemaBySubject method, which is GET /subject/{subject}
   I think it's necessary to add the following method.
   1、GET /schema/ids/{id}
   get schema by a specified schemaID
   2、GET /subject/{subject}/schema/versions/{version}
   get schema by the topic and a given version
   3、GET /subject/{subject}/schema/versions
   get all versions of schema by the topic
   4、the existing getSchemaBySubject method can be changed to GET /subject/{subject}/schema, which means to get the latest (or binding) schema version of this subject
   
   I will submit PR to try to solve the above problem.
   @ferrirW  We can discuss more about the REST interface definition. Try to align the following examples.
   Open-messaging schema: https://github.com/openmessaging/openschema/blob/master/spec_cn.md
   Confluent schema: [SubjectVersionsResource](https://github.com/confluentinc/schema-registry/blob/master/core/src/main/java/io/confluent/kafka/schemaregistry/rest/resources/SubjectVersionsResource.java#L71)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq-schema-registry] ferrirW commented on issue #2: SchemaController optimize

Posted by GitBox <gi...@apache.org>.
ferrirW commented on issue #2:
URL: https://github.com/apache/rocketmq-schema-registry/issues/2#issuecomment-1188988640

   1. In our design, schema is a table like concept. When the schema or table structure changed, its version number will increase, but the ID should remain the same. As long as we promise that schema ID + version is unique, producer / consumer can use like "schemaId#version" to pointed the schema. 
   At the same time, since we use the snowflake algorithm to realize unique ids, reducing the generation of ids can also avoid conflicts.
   
   2. I totally agree that there needs to be some more detailed errorcodes.
   
   3. yes, current version contains only the most basic functions including add, delete, update and get. So any extension to the interface is very welcome.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq-schema-registry] MatrixHB closed issue #2: SchemaController optimize

Posted by GitBox <gi...@apache.org>.
MatrixHB closed issue #2: SchemaController optimize
URL: https://github.com/apache/rocketmq-schema-registry/issues/2


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org