michaeljmarshall commented on a change in pull request #11974:
URL: https://github.com/apache/pulsar/pull/11974#discussion_r761432632
##########
File path:
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/ConsumerBuilder.java
##########
@@ -763,4 +763,12 @@
* </pre>
*/
ConsumerBuilder<T>
negativeAckRedeliveryBackoff(NegativeAckRedeliveryBackoff
negativeAckRedeliveryBackoff);
+
+ /**
+ * Start the consumer in a paused state. When enabled, the consumer does
not immediately fetch messages when
+ * {@link #subscribe()} is called. Instead, the consumer waits to fetch
messages until {@link Consumer#resume()} is called.
+ * <p/>
+ * See also {@link Consumer#pause()}.
+ */
+ ConsumerBuilder<T> paused(boolean paused);
Review comment:
@zwalsh-toast - what do you think about renaming this method to
`startPaused`? It would then align with the configuration class.
```suggestion
ConsumerBuilder<T> startPaused(boolean startPaused);
```
##########
File path:
pulsar-client/src/test/java/org/apache/pulsar/client/impl/ConsumerImplTest.java
##########
@@ -200,4 +201,21 @@ public void testClose() {
}
Assert.assertNull(checkException);
}
+
+ @Test
+ public void testConsumerCreatedWhilePaused() throws InterruptedException {
Review comment:
Do you think you could write a test that relies on the `ConsumerBuilder`
implementation? That way we can exercise all of your changes.
##########
File path:
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/ConsumerBuilder.java
##########
@@ -763,4 +763,12 @@
* </pre>
*/
ConsumerBuilder<T>
negativeAckRedeliveryBackoff(NegativeAckRedeliveryBackoff
negativeAckRedeliveryBackoff);
+
+ /**
+ * Start the consumer in a paused state. When enabled, the consumer does
not immediately fetch messages when
Review comment:
I think it would be helpful to state in the Javadoc that the default
value for `paused` (or `startPaused`) is `false`.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]