BewareMyPower commented on code in PR #18633:
URL: https://github.com/apache/pulsar/pull/18633#discussion_r1034243195


##########
pulsar-broker/src/test/java/org/apache/pulsar/client/impl/TopicsConsumerImplTest.java:
##########
@@ -539,6 +540,38 @@ public void testTopicNameValid() throws Exception{
         }).get();
     }
 
+    @Test
+    public void testExclusiveSubscribe() throws Exception {
+        final String topicName = 
"persistent://prop/use/ns-abc/testTopicNameValid";
+        TenantInfoImpl tenantInfo = createDefaultTenantInfo();
+        admin.tenants().createTenant("prop", tenantInfo);
+        admin.topics().createPartitionedTopic(topicName, 3);
+        List<Integer> partitions = new ArrayList<>();
+        for (int i = 0; i < 3; i++) {
+            partitions.add(i);
+        }
+        List<String> realTopics = partitions.stream()
+                .map(idx -> topicName + "-partition-" + idx)
+                .collect(Collectors.toList());
+        Consumer<byte[]> consumer1 = pulsarClient.newConsumer()
+                .topics(realTopics)

Review Comment:
   +1, we can subscribe the partitioned topic directly instead of all these 
partitions.
   
   ```java
           Consumer<byte[]> consumer1 = pulsarClient.newConsumer()
                   .topic(topicName)
   ```



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