jiazhai commented on a change in pull request #2346: Issue #2330: change 
getTopicName in MultiTopicsConsumer
URL: https://github.com/apache/incubator-pulsar/pull/2346#discussion_r209413876
 
 

 ##########
 File path: 
pulsar-client/src/main/java/org/apache/pulsar/client/impl/TopicMessageImpl.java
 ##########
 @@ -40,10 +44,20 @@
     }
 
     /**
-     * Get the topic name of this message.
+     * Get the topic name without partition part of this message.
      * @return the name of the topic on which this message was published
      */
     public String getTopicName() {
+        int position = topicName.lastIndexOf(PARTITIONED_TOPIC_SUFFIX);
+        checkState(position != -1, "Topic Name not contains partition part. " 
+ topicName);
+        return topicName.substring(0, position);
 
 Review comment:
   @sijie Thanks. will keep the topicPartitionName while constructing.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to