MatrixHB commented on code in PR #63:
URL:
https://github.com/apache/rocketmq-schema-registry/pull/63#discussion_r983052516
##########
client/src/main/java/org/apache/rocketmq/schema/registry/client/serde/avro/AvroDeserializer.java:
##########
@@ -59,7 +58,11 @@ public void configure(Map<String, Object> configs) {
}
@Override
- public T deserialize(String subject, byte[] payload)
+ public T deserialize(String subject, byte[] payload) {
+ return this.deserialize(subject, payload, null);
+ }
Review Comment:
1、byRecordId 更适合于message场景和connect场景,这两个场景下注重“限制”、“类型安全”,我觉得没问题。
2、但是schema的作用不会仅限于“限制”和“数据治理”,我认为另一个大的价值是“Table化”和“列读”,尤其在ETL
场景。假设我们原来有一个topic,Producer已经生产了大量的存量消息,我们创建了schema之后Producer还没来得及改造成传递recordId的
发送方式,这种情况下如果要用streams分析这些消息数据,会因为没有RecordId 直接无法解析而浪费掉数据。
3、我想表达的也不全是 “增加一种不依赖 Schema server 的分支”,而是我们的消息解析 可以同时支持 deserialize
bySubject 和 byRecordId ,这两种都是依赖registry的,都是能保障类型安全的,只不过bySubject
的保障稍微弱一些,byRecordId 严格以版本为保障,类型安全更强。 但是 bySubject 可以让消息不强依赖
recordId,我们能分析的RocketMQ数据源才能更多、更灵活。
--
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]