sijie commented on a change in pull request #3079: Change un-ack messages 
tracking behavior
URL: https://github.com/apache/pulsar/pull/3079#discussion_r237218108
 
 

 ##########
 File path: 
pulsar-broker/src/test/java/org/apache/pulsar/client/api/DeadLetterTopicTest.java
 ##########
 @@ -256,4 +257,29 @@ public void testDeadLetterTopicByCustomTopicName() throws 
Exception {
         assertNull(checkMessage);
         checkConsumer.close();
     }
+
+    @Test(timeOut = 200000)
+    public void testDeadLetterWithoutConsumerReceiveImmediately() throws 
PulsarClientException, InterruptedException {
+        final String topic = 
"persistent://my-property/my-ns/dead-letter-topic-without-consumer-receive-immediately";
+
+        Consumer<byte[]> consumer = pulsarClient.newConsumer()
+                .topic(topic)
+                .subscriptionType(SubscriptionType.Shared)
+                .subscriptionName("my-subscription")
+                .ackTimeout(3, TimeUnit.SECONDS)
+                
.deadLetterPolicy(DeadLetterPolicy.builder().maxRedeliverCount(2).build())
+                .subscribe();
+
+        Producer<byte[]> producer = pulsarClient.newProducer()
+                .topic(topic)
+                .create();
+
+        producer.send(("a message").getBytes());
+
+        // wait a while, message will send to dead letter topic
 
 Review comment:
   the comment doesn't seem to be right.

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