yjshen commented on a change in pull request #5788: [pulsar-java-client] 
Decouple partition switch frequency with maxPublishDelay in producer 
configuration
URL: https://github.com/apache/pulsar/pull/5788#discussion_r353508179
 
 

 ##########
 File path: 
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/ProducerBuilder.java
 ##########
 @@ -349,6 +349,20 @@
      */
     ProducerBuilder<T> batchingMaxPublishDelay(long batchDelay, TimeUnit 
timeUnit);
 
+    /**
+     * Set the partition switch frequency while batching of messages is 
enabled and
+     * using round-robin routing mode for non-keyed message <i>default: 10</i>.
+     *
+     * The time period of partition switch is frequency * 
batchingMaxPublishDelay. During this period,
+     * all messages arrives will be route to the same partition.
+     *
+     * @param frequency the frequency of partition switch
+     * @return the producer builder instance
+     * @see #messageRoutingMode(MessageRoutingMode)
+     * @see #batchingMaxPublishDelay(long, TimeUnit)
+     */
+    ProducerBuilder<T> batchingPartitionSwitchFrequency(int frequency);
 
 Review comment:
   The current frequency is used to compute switch delay in `frequency` * 
`maxBatchDelayMicros`. Do you mean I should make it a standalone variable? Then 
if users didn't set this variable, or the user is setting a variable less than 
`maxBatchDelay`, I need to use `maxBatchDelay` in round-robin partitioner?

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

Reply via email to