merlimat commented on a change in pull request #5339: Not allow use 
acknowledgeCumulative on Key_shared subscription.
URL: https://github.com/apache/pulsar/pull/5339#discussion_r332631574
 
 

 ##########
 File path: 
pulsar-broker/src/test/java/org/apache/pulsar/client/api/KeySharedSubscriptionTest.java
 ##########
 @@ -295,6 +295,33 @@ public void testDisableKeySharedSubscription() throws 
PulsarClientException {
             .subscribe();
     }
 
+    @Test()
+    public void testCannotUseAcknowledgeCumulative() throws 
PulsarClientException {
+        this.conf.setSubscriptionKeySharedEnable(true);
+        String topic = 
"persistent://public/default/key_shared_ack_cumulative-" + UUID.randomUUID();
+
+        @Cleanup
+        Producer<Integer> producer = createProducer(topic, false);
+
+        @Cleanup
+        Consumer<Integer> consumer = createConsumer(topic);
+
+        for (int i = 0; i < 10; i++) {
+            producer.send(i);
+        }
+
+        for (int i = 0; i < 10; i++) {
+            Message<Integer> message = consumer.receive();
+            if (i == 9) {
+                try {
+                    consumer.acknowledgeCumulative(message);
 
 Review comment:
   add `fail("should have failed")` after calling ack, to verify the call is 
indeed throwing exception

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to