poorbarcode commented on code in PR #18407:
URL: https://github.com/apache/pulsar/pull/18407#discussion_r1019209620
##########
pulsar-broker/src/test/java/org/apache/pulsar/client/impl/NegativeAcksTest.java:
##########
@@ -362,4 +364,34 @@ public void testNegativeAcksWithBatchAckEnabled() throws
Exception {
// There should be no more messages
assertNull(consumer.receive(100, TimeUnit.MILLISECONDS));
}
+
+ @DataProvider(name = "subscriptionType")
+ public static Object[][] subscriptionType() {
+ return new Object[][] {{SubscriptionType.Failover},
{SubscriptionType.Exclusive}};
+ }
+
+ @Test(dataProvider = "subscriptionType")
+ public void testFailOverConsumerCumulativeAck(SubscriptionType type)
throws Exception {
+ log.info("-- Starting {} test --", methodName);
+ final String topicName =
BrokerTestUtil.newUniqueName("persistent://my-property/my-ns/testFailOverConsumerCumulativeAck");
+ Producer<byte[]> producer = pulsarClient.newProducer()
+ .topic(topicName)
+ .create();
+ ConsumerImpl<byte[]> consumer = (ConsumerImpl<byte[]>)
pulsarClient.newConsumer()
+ .topic(topicName)
+ .subscriptionName("sub")
+ .subscriptionType(type)
+ .ackTimeout(5, TimeUnit.SECONDS)
+ .acknowledgmentGroupTime(100, TimeUnit.MILLISECONDS)
+
.subscriptionInitialPosition(SubscriptionInitialPosition.Latest)
+ .subscribe();
+ final MessageId msgId = producer.send("1".getBytes());
Review Comment:
Should we send more than one messages and ack the last one to ensure
`unAckedMessageTracker.removeMessagesTill` works?
--
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]