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


##########
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:
   We couldn't enable the batching and chunking at the same time. This will 
throw an exception when initializing the retryLetterProducer:
   
https://github.com/apache/pulsar/blob/02147454c425b92f0cd1caefa73b9339db6a0269/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerBuilderImpl.java#L96-L97



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