MatrixHB commented on PR #16:
URL:
https://github.com/apache/rocketmq-schema-registry/pull/16#issuecomment-1200386472
> > I have an idea about design of schema serializer/deserializer
> > What's exposed to users is `SchemaWrapper`, which includes
`Map<String/*SchemaType*/, Serializer>` and `Map<String/*SchemaType*/,
Deserializer>`(such as <AVRO, AvroSerializer>, or use Factory...). Then the
user doesn't need to know the schema type (avro/json/thrift....) and just leave
the serializer work to `SchemaWrapper`. In `SchemaWrapper`, after getting
schema from registry, we can know the type of schema, then we can decide what
kind of serializer to use.
>
> Yes, that's why StorageInfo exist in SchemaInfo, we can use this
inforamtion to manage user's ser/de process and data format.
>
> But now server side is not ready yet. And in my opinion, exposes the type
of Avro/PB/JSON to user is more easier understand and change.
>
> How about that as a follow-up improvement? @MatrixHB
@ferrirW I agree that it can be a follow-up improvement.
However, now the `SchemaRegistryClient` is injected into
AvroSerializer/AvroDeserializer. If we want to use StorageInfo or SchemaType to
decide ser/de process, we need to inject `SchemaRegistryClient` and the
`getSchemaBySubject` logic into SchemaWapper but not Ser/De.
Will it be difficult to change when doing follow-up improvement?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]