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 2018/03/19 05:03:59 UTC

[GitHub] sijie commented on a change in pull request #1387: Build batching-awareness into round-robin message router

sijie commented on a change in pull request #1387: Build batching-awareness into round-robin message router
URL: https://github.com/apache/incubator-pulsar/pull/1387#discussion_r175332357
 
 

 ##########
 File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/PartitionedProducerImpl.java
 ##########
 @@ -76,7 +77,11 @@ private MessageRouter getMessageRouter() {
             messageRouter = customMessageRouter;
             break;
         case RoundRobinPartition:
-            messageRouter = new RoundRobinPartitionMessageRouterImpl(conf.getHashingScheme());
+            messageRouter = new RoundRobinPartitionMessageRouterImpl(
+                conf.getHashingScheme(),
+                ThreadLocalRandom.current().nextInt(topicMetadata.numPartitions()),
+                conf.isBatchingEnabled(),
+                TimeUnit.MICROSECONDS.toMillis(conf.getBatchingMaxPublishDelayMicros()));
 
 Review comment:
   fixed by doing "Math.max(1, ...)"

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services