Dream95 commented on code in PR #25921:
URL: https://github.com/apache/pulsar/pull/25921#discussion_r3353088475


##########
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/TopicMessageId.java:
##########
@@ -41,6 +41,19 @@ public interface TopicMessageId extends MessageId {
      */
     String getOwnerTopic();
 
+    /**
+     * Checks if this message's owner topic and the given topic refer to the 
same base
+     * partitioned topic by comparing their base partitioned topic names.
+     *
+     * <p>For example, {@code 
persistent://public/default/my-topic-partition-0} matches
+     * {@code persistent://public/default/my-topic} or any other partition of 
that topic.
+     * Topics sharing only a name prefix (e.g., {@code my-topic} vs {@code 
my-topic-v2}) do not match.
+     *
+     * @param topicName a full topic name (non-partitioned, partitioned, or 
specific partition)
+     * @return {@code true} if both topics resolve to the same base 
partitioned topic name
+     */
+    boolean hasSameBasePartitionedTopic(String topicName);

Review Comment:
   Since TopicMessageId lives in the pulsar-client-api module while TopicName 
lives in pulsar-common, and pulsar-common already depends on pulsar-client-api, 
adding a dependency on pulsar-common to pulsar-client-api would create a 
circular compile dependency. 



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