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/01/05 08:22:32 UTC

[GitHub] sijie commented on a change in pull request #1025: Issue 1024: Message Router should take `numPartitions` as parameter in choosing partition

sijie commented on a change in pull request #1025: Issue 1024: Message Router should take `numPartitions` as parameter in choosing partition
URL: https://github.com/apache/incubator-pulsar/pull/1025#discussion_r159826730
 
 

 ##########
 File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/PartitionedProducerImpl.java
 ##########
 @@ -40,21 +44,45 @@
 
 public class PartitionedProducerImpl extends ProducerBase {
 
+    private static final Random RANDOM = new Random(System.currentTimeMillis());
 
 Review comment:
   I was thinking about the case when you have a client producing to multiple topics, you will end up creating multiple random instances. I can switch to use ThreadLocalRandom if there is a concern using a static instance.

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