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/07/02 09:04:21 UTC

[GitHub] [pulsar] codelipenghui commented on a diff in pull request #16336: [improve][java-client] Improve performance of multi-topic consumer with more than one IO thread

codelipenghui commented on code in PR #16336:
URL: https://github.com/apache/pulsar/pull/16336#discussion_r912340976


##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/MultiTopicsConsumerImpl.java:
##########
@@ -1045,6 +1054,12 @@ private void doSubscribeTopicPartitions(Schema<T> schema,
                         String partitionName = TopicName.get(topicName).getPartition(partitionIndex).toString();
                         CompletableFuture<Consumer<T>> subFuture = new CompletableFuture<>();
                         configurationData.setStartPaused(paused);
+                        BatchReceivePolicy internalBatchReceivePolicy = BatchReceivePolicy.builder()
+                                .maxNumMessages(Math.max(receiverQueueSize / 2, 1))
+                                .maxNumBytes(-1)
+                                .timeout(0, TimeUnit.MILLISECONDS)
+                                .build();
+                        configurationData.setBatchReceivePolicy(internalBatchReceivePolicy);

Review Comment:
   @Jason918 Fixed.



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