rdhabalia commented on a change in pull request #10184:
URL: https://github.com/apache/pulsar/pull/10184#discussion_r611006715



##########
File path: 
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/Schema.java
##########
@@ -120,6 +122,21 @@ default T decode(byte[] bytes, byte[] schemaVersion) {
         return decode(bytes);
     }
 
+    /**
+     * Decode a ByteBuf into an object using a given version. <br/>
+     * <b>NOTE</b>: This method should not modify reader/writer index of 
ByteBuf else it can cause corruption while
+     * accessing same ByteBuf for decoding and deserialization.
+     *
+     * @param byteBuf
+     *            the byte array to decode
+     * @param schemaVersion
+     *            the schema version to decode the object. null indicates 
using latest version.
+     * @return the deserialized object
+     */
+    default T decode(ByteBuf bytes, byte[] schemaVersion) {
+        return null;

Review comment:
       custom schema will not break, `MessageImpl` already handles and calls 
default `decode`. calling default decode from here will require ByteBuf 
conversion to byte[] which should be handled at top level and in this case we 
are handling at `MessageImpl`




-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to