void-ptr974 commented on code in PR #25921:
URL: https://github.com/apache/pulsar/pull/25921#discussion_r3353691750
##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/TopicMessageIdImpl.java:
##########
@@ -92,6 +93,12 @@ public String getOwnerTopic() {
return ownerTopic;
}
+ @Override
+ public boolean hasSameBasePartitionedTopic(String topicName) {
+ return TopicName.get(getOwnerTopic()).getPartitionedTopicName()
+ .equals(TopicName.get(topicName).getPartitionedTopicName());
+ }
Review Comment:
Since this is only used by client internals, would an internal
static/package-private helper in `pulsar-client` be a better fit than exposing
it on `TopicMessageId`?
For example:
static boolean hasSameBasePartitionedTopic(TopicMessageId messageId, String
topicName) {
return TopicName.get(messageId.getOwnerTopic()).getPartitionedTopicName()
.equals(TopicName.get(topicName).getPartitionedTopicName());
}
This also avoids adding a `pulsar-client-api -> pulsar-common` dependency.
This is mainly an API design discussion point from my side. It may be better
to wait for lhotari/maintainer input before deciding the final shape.
--
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]