RobertIndie commented on code in PR #20936:
URL: https://github.com/apache/pulsar/pull/20936#discussion_r1287018770


##########
pulsar-client/src/test/java/org/apache/pulsar/client/impl/ConsumerBuilderImplTest.java:
##########
@@ -346,6 +349,36 @@ public void testNullDeadLetterPolicy() {
         verify(consumerBuilderImpl.getConf()).setDeadLetterPolicy(null);
     }
 
+    @Test
+    public void testNonNullDeadLetterPolicy() {
+        PulsarClientImpl client = mock(PulsarClientImpl.class);
+        ConsumerConfigurationData consumerConfigurationData = 
mock(ConsumerConfigurationData.class);
+        
doCallRealMethod().when(consumerConfigurationData).setDeadLetterPolicy(any());
+        
when(consumerConfigurationData.getDeadLetterPolicy()).thenCallRealMethod();
+        ConsumerBuilderImpl<byte[]> consumerBuilder = new 
ConsumerBuilderImpl(client, consumerConfigurationData, Schema.BYTES);
+
+        consumerBuilder.deadLetterPolicy(DeadLetterPolicy.builder()
+                .retryLetterTopic("new-retry")
+                .initialSubscriptionName("new-dlq-sub")
+                .deadLetterTopic("new-dlq")
+                .maxRedeliverCount(2)
+                .deadLetterBatchingEnabled(false)
+                .deadLetterChunkingEnabled(false)
+                .retryLetterBatchingEnabled(true)
+                .retryLetterChunkingEnabled(true)

Review Comment:
   IMO, we shouldn't expose these configurations to DeadLetterPolicy. This will 
introduce some producer concepts to the consumer. 



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

Reply via email to