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 2019/06/27 13:38:48 UTC

[GitHub] [pulsar] sijie commented on a change in pull request #4621: Support batch receive in java client.

sijie commented on a change in pull request #4621: Support batch receive in java client.
URL: https://github.com/apache/pulsar/pull/4621#discussion_r298173623
 
 

 ##########
 File path: pulsar-client-api/src/main/java/org/apache/pulsar/client/api/ConsumerBuilder.java
 ##########
 @@ -501,4 +501,20 @@
      *            whether to auto update partition increasement
      */
     ConsumerBuilder<T> autoUpdatePartitions(boolean autoUpdate);
+
+    /**
+     * Set batch receive policy {@link BatchReceivePolicy} for consumer.
+     * By default, consumer will use {@link BatchReceivePolicy#DEFAULT_POLICY} as batch receive policy.
+     *
+     * Example:
+     * <pre>
+     * client.newConsumer().batchReceivePolicy(BatchReceivePolicy.builder()
+     *              .maxNumberOfMessages(100)
+     *              .maxSizeOfMessages(5 * 1024 * 1024)
+     *              .timeout(100)
 
 Review comment:
   I think it is better to have a builder method `timeout(long timeout, TimeUnit timeoutUnit)` rather than having two separated methods.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services