shibd commented on code in PR #25304:
URL: https://github.com/apache/pulsar/pull/25304#discussion_r2923482185
##########
pulsar-common/src/main/java/org/apache/pulsar/common/naming/TopicName.java:
##########
@@ -133,40 +126,20 @@ private TopicName(String completeTopicName) {
}
}
- // The fully qualified topic name can be in two different forms:
- // new: persistent://tenant/namespace/topic
- // legacy: persistent://tenant/cluster/namespace/topic
-
+ // Expected format: persistent://tenant/namespace/topic
List<String> parts =
Splitter.on("://").limit(2).splitToList(completeTopicName);
this.domain = TopicDomain.getEnum(parts.get(0));
String rest = parts.get(1);
- // The rest of the name can be in different forms:
- // new: tenant/namespace/<localName>
- // legacy: tenant/cluster/namespace/<localName>
- // Examples of localName:
- // 1. some, name, xyz
- // 2. xyz-123, feeder-2
-
-
- parts = Splitter.on("/").limit(4).splitToList(rest);
+ // Expected format: tenant/namespace/<localName>
Review Comment:
So, with this limitation, it means we cannot allow `/` in topic names.
Would this be a breaking change? Currently, users are still able to produce
and consume messages using topic names that contain `/`:
`persistent://tenant/cluster/namespace/topic (topic name is: namespace/topic )`
Of course, we could restrict topic names from containing `/`. Even if it is
a breaking change, I think it would be meaningful in the long run.
--
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]