You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/05/12 06:43:41 UTC

[GitHub] [pulsar] eolivelli commented on a change in pull request #10476: PIP-85 Add Schema Information to Message in Java Client API

eolivelli commented on a change in pull request #10476:
URL: https://github.com/apache/pulsar/pull/10476#discussion_r630766051



##########
File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/MessageImpl.java
##########
@@ -384,10 +385,29 @@ public int size() {
         return payload.readableBytes();
     }
 
-    public Schema<T> getSchema() {
+    public Schema<T> getSchemaInternal() {
         return this.schema;
     }
 
+    @Override
+    public Optional<Schema<?>> getReaderSchema() {
+        ensureSchemaIsLoaded();
+        if (schema == null) {
+            return Optional.empty();
+        }
+        if (schema instanceof AutoConsumeSchema) {

Review comment:
       @congbobo184 I am afraid that this change may have side effects, `AutoConsumeSchema` is very special as well as `AbstractSchema`
   
   If you want I can try to apply this suggestion in a follow up patch




-- 
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:
users@infra.apache.org