You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2019/12/03 07:31:30 UTC

[GitHub] [pulsar] huangdx0726 commented on a change in pull request #5716: [Issues 5709]remove the namespace checking

huangdx0726 commented on a change in pull request #5716: [Issues 5709]remove the namespace checking
URL: https://github.com/apache/pulsar/pull/5716#discussion_r353019113
 
 

 ##########
 File path: pulsar-client/src/test/java/org/apache/pulsar/client/impl/MultiTopicsConsumerImplTest.java
 ##########
 @@ -62,4 +71,43 @@ public void testGetStats() throws Exception {
         impl.getStats();
     }
 
+    @Test
+    public void multiTopicsInDifferentNameSpace() throws PulsarClientException {
+        List<String> topics = new ArrayList<>();
+        topics.add("persistent://public/default/MultiTopics1");
+        topics.add("persistent://public/test-multi/MultiTopics2");
+        topics.add("persistent://public/test-multi/MultiTopics3");
+        ClientConfigurationData conf = new ClientConfigurationData();
+        conf.setServiceUrl("pulsar://localhost:6650");
+        conf.setStatsIntervalSeconds(100);
+
+        PulsarClientImpl clientImpl = new PulsarClientImpl(conf);
+
+        Consumer consumer = clientImpl.newConsumer().topics(topics)
+                .subscriptionName("multiTopicSubscription")
+                .messageListener(new MessageListener<byte[]>() {
+                    @Override
+                    public void received(Consumer<byte[]> consumer, Message<byte[]> msg) {
+                       if("producer".equals(msg.getProducerName()) || "producer1".equals(msg.getProducerName())){
+                           String message = new String(msg.getData());
+                           assertTrue(message.contains("MultiTopics"));
 
 Review comment:
   I'v fixed ,PTAL.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services