congbobo184 commented on code in PR #16659:
URL: https://github.com/apache/pulsar/pull/16659#discussion_r929493209
##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/MessageImpl.java:
##########
@@ -489,9 +490,9 @@ private T decodeBySchema(byte[] schemaVersion) {
return value;
}
if (null == schemaVersion) {
- return schema.decode(getData());
+ return schema.decode(new ReadonlyByteBufInputStream(payload));
Review Comment:
why should we change this logic?
https://github.com/apache/pulsar/blob/176418765eed3775758a1293217ca5928b47579b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/schema/AbstractStructSchema.java#L70-L72
has changed this to `ByteBufInputStream` right?
##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/MessageImpl.java:
##########
@@ -489,9 +490,9 @@ private T decodeBySchema(byte[] schemaVersion) {
return value;
}
if (null == schemaVersion) {
- return schema.decode(getData());
+ return schema.decode(new ReadonlyByteBufInputStream(payload));
} else {
- return schema.decode(getData(), schemaVersion);
+ return schema.decode(new ReadonlyByteBufInputStream(payload),
schemaVersion);
Review Comment:
same above
--
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]