sijie commented on a change in pull request #3876: Add the multi version schema support URL: https://github.com/apache/pulsar/pull/3876#discussion_r273289771
########## File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java ########## @@ -153,17 +157,22 @@ } static <T> ConsumerImpl<T> newConsumerImpl(PulsarClientImpl client, String topic, ConsumerConfigurationData<T> conf, - ExecutorService listenerExecutor, int partitionIndex, CompletableFuture<Consumer<T>> subscribeFuture, - SubscriptionMode subscriptionMode, MessageId startMessageId, Schema<T> schema, ConsumerInterceptors<T> interceptors) { - return ConsumerImpl.newConsumerImpl(client, topic, conf, listenerExecutor, partitionIndex, subscribeFuture, subscriptionMode, - startMessageId, schema, interceptors, Backoff.DEFAULT_INTERVAL_IN_NANOSECONDS, Backoff.MAX_BACKOFF_INTERVAL_NANOSECONDS); - } + ExecutorService listenerExecutor, int partitionIndex, CompletableFuture<Consumer<T>> subscribeFuture, + SubscriptionMode subscriptionMode, MessageId startMessageId, Schema<T> schema, ConsumerInterceptors<T> interceptors, + long backoffIntervalNanos, long maxBackoffIntervalNanos) { + if (schema != null && schema.supportSchemaVersioning()) { + SchemaProvider schemaProvider = new MultiVersionGenericSchemaProvider(TopicName.get(topic), client); Review comment: I think we can cache `MultiVersionGenericSchemaProvider` for topics. Otherwise if a topic have N partitions, we will have create N schema providers. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services