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 2022/05/18 14:07:09 UTC

[GitHub] [pulsar] BewareMyPower commented on issue #15639: [Admin] Support updating schema with version as the result

BewareMyPower commented on issue #15639:
URL: https://github.com/apache/pulsar/issues/15639#issuecomment-1130064801

   The design of the `Schemas#createSchema` API is bad but it does exist. For compatibility, it's better not to add a new API.
   
   At the moment we can implement the **correct API** by:
   
   ```java
       private static CompletableFuture<Long> postSchemaAsync(
               final PulsarAdmin admin, final String topic, final SchemaInfo schemaInfo) {
           final Schemas schemas = admin.schemas();
           return schemas.createSchemaAsync(topic, schemaInfo)
                   .thenCompose(__ -> schemas.getSchemaInfoWithVersionAsync(topic))
                   .thenApply(SchemaInfoWithVersion::getVersion);
       }
   ```


-- 
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-unsubscribe@pulsar.apache.org

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