You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2021/10/26 05:01:00 UTC
[GitHub] [rocketmq] colin-lee commented on a change in pull request #3427: [ISSUE#3426] reduce unnecessary regex matches when namespace is null
colin-lee commented on a change in pull request #3427:
URL: https://github.com/apache/rocketmq/pull/3427#discussion_r736146388
##########
File path: client/src/main/java/org/apache/rocketmq/client/ClientConfig.java
##########
@@ -274,20 +275,28 @@ public void setLanguage(LanguageCode language) {
}
public String getNamespace() {
+ if (namespaceInitialized) {
+ return namespace;
+ }
+
if (StringUtils.isNotEmpty(namespace)) {
return namespace;
}
if (StringUtils.isNotEmpty(this.namesrvAddr)) {
if (NameServerAddressUtils.validateInstanceEndpoint(namesrvAddr)) {
- return NameServerAddressUtils.parseInstanceIdFromEndpoint(namesrvAddr);
+ namespace = NameServerAddressUtils.parseInstanceIdFromEndpoint(namesrvAddr);
Review comment:
please fixup it.
--
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: dev-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org