Jason918 commented on a change in pull request #3427:
URL: https://github.com/apache/rocketmq/pull/3427#discussion_r736084914



##########
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:
       The `namesrvAddr` is not final and can be updated after creation.
   This will break the compatibility.
   It's better that we can update namespace in `setNamesrvAddr`.




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