Denovo1998 commented on code in PR #17449:
URL: https://github.com/apache/pulsar/pull/17449#discussion_r1059014300


##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/schema/AutoConsumeSchema.java:
##########
@@ -140,7 +150,7 @@ public void setSchemaInfoProvider(SchemaInfoProvider 
schemaInfoProvider) {
     @Override
     public SchemaInfo getSchemaInfo() {
         if (!schemaMap.containsKey(SchemaVersion.Latest)) {
-            return null;
+            return SCHEMA_INFO;

Review Comment:
   1.In AutoConsumeSchema, we don't change getSchemaInfo:
   ```
       @Override
       public SchemaInfo getSchemaInfo() {
           if (!schemaMap.containsKey(SchemaVersion.Latest)) {
               return null;
           }
           return schemaMap.get(SchemaVersion.Latest).getSchemaInfo();
       }
   ```
   2.Add a new method in AutoConsumeSchema:
   ```
       public SchemaInfo getAutoConsumeSchemaInfo() {
           return SCHEMA_INFO;
       }
   ```
   3.In ConsumerImpl:
   ```
       SchemaInfo si = schema.getSchemaInfo();
       if (si != null && (SchemaType.BYTES == si.getType() || SchemaType.NONE 
== si.getType())) {
           // don't set schema for Schema.BYTES
           si = null;
       } else {
           if (schema instanceof AutoConsumeSchema) {
               si = ((AutoConsumeSchema) schema).getAutoConsumeSchemaInfo();
           }
       }
   ```
   Is that OK?



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

Reply via email to