merlimat commented on a change in pull request #2400: PIP-22: Dead Letter Topic
URL: https://github.com/apache/incubator-pulsar/pull/2400#discussion_r212524486
 
 

 ##########
 File path: 
pulsar-client/src/main/java/org/apache/pulsar/client/api/ConsumerBuilder.java
 ##########
 @@ -330,4 +330,24 @@
      * Set subscriptionInitialPosition for the consumer
     */
     ConsumerBuilder<T> subscriptionInitialPosition(SubscriptionInitialPosition 
subscriptionInitialPosition);
+
+    /**
+     * Set maximum number of redelivery.
+     * Message exceeding the maximum number of redelivery will send to Dead 
Letter Topic and acknowledged automatic.
+     * @param maxRedeliveryCount maximum number of redelivery
+     */
+    ConsumerBuilder<T> maxRedeliveryCount(int maxRedeliveryCount);
+
+    /**
+     * Set name of Dead Letter Topic.
+     * Before set name of Dead Letter Topic, ensure that maxRedeliveryCount > 0
+     * @param deadLetterTopic name of dead letter topic
+     */
+    ConsumerBuilder<T> deadLetterTopic(String deadLetterTopic);
+
+    /**
+     * Set max un-acked messages per consumer.
+     * This config should less than broker config, if not, config will not 
enable. 0 is not limit, default is 0
+     */
+    ConsumerBuilder<T> maxUnackedMessagesPerConsumer(int 
maxUnackedMessagesPerConsumer);
 
 Review comment:
   From API perspective it might be good to encapsulate all the DLQ related 
settings into a single `DeadLetterQueuePolicy` 

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to