nodece commented on code in PR #17318:
URL: https://github.com/apache/pulsar/pull/17318#discussion_r963221321


##########
pulsar-broker/src/test/java/org/apache/pulsar/client/impl/MessageRedeliveryTest.java:
##########
@@ -324,6 +326,77 @@ public void testRedeliveryAddEpoch(boolean enableBatch) 
throws Exception{
         assertEquals(message.getValue(), test3);
     }
 
+    @Test(dataProvider = "enableBatch")
+    public void testBatchReceiveRedeliveryAddEpoch(boolean enableBatch) throws 
Exception{
+        final String topic = "testBatchReceiveRedeliveryAddEpoch";
+        final String subName = "my-sub";
+        ConsumerBase<String> consumer = ((ConsumerBase<String>) 
pulsarClient.newConsumer(Schema.STRING)
+                .topic(topic)
+                .subscriptionName(subName)
+                .batchReceivePolicy(BatchReceivePolicy.builder().timeout(1000, 
TimeUnit.MILLISECONDS).build())
+                .subscriptionType(SubscriptionType.Failover)
+                .subscribe());
+
+        Producer<String> producer = pulsarClient.newProducer(Schema.STRING)
+                .topic(topic)
+                .enableBatching(enableBatch)
+                .create();
+
+        String test1 = "Pulsar1";
+        String test2 = "Pulsar2";
+        String test3 = "Pulsar3";
+        producer.send(test1);
+
+        PersistentTopic persistentTopic = (PersistentTopic) 
pulsar.getBrokerService().getTopics()
+                .get(TopicName.get("persistent://public/default/" + 
topic).toString()).get().get();
+        PersistentDispatcherSingleActiveConsumer 
persistentDispatcherSingleActiveConsumer =
+                (PersistentDispatcherSingleActiveConsumer) 
persistentTopic.getSubscription(subName).getDispatcher();
+

Review Comment:
   `persistentTopic` and `persistentDispatcherSingleActiveConsumer` looks 
unnecessary.



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