gaoran10 commented on code in PR #24488:
URL: https://github.com/apache/pulsar/pull/24488#discussion_r2299681668


##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/MessageImpl.java:
##########
@@ -424,6 +424,23 @@ public byte[] getSchemaVersion() {
         }
     }
 
+    @Override
+    public byte[] getSchemaId() {
+        if (msgMetadata.hasSchemaId()) {
+            byte[] schemaId = msgMetadata.getSchemaId();
+            return (schemaId.length == 0) ? null : schemaId;
+        }
+        return null;
+    }
+
+    private byte[] getSchemaFlag() {
+        if (msgMetadata.hasSchemaId()) {
+            byte[] schemaId = msgMetadata.getSchemaId();
+            return (schemaId.length == 0) ? null : schemaId;
+        }

Review Comment:
   Yes, you are right, the schema ID should only be used to decode the message 
payload.
   
   - Changed get schemaInfo to use the schema version.
   - Changed get schema reader to use the schema version.
   



-- 
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: commits-unsubscr...@pulsar.apache.org

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

Reply via email to