ShannonDing commented on a change in pull request #315: [ISSUE #314] support 
name server domain
URL: https://github.com/apache/rocketmq-client-go/pull/315#discussion_r359178417
 
 

 ##########
 File path: internal/namesrv.go
 ##########
 @@ -125,3 +138,88 @@ func (s *namesrvs) SetCredentials(credentials 
primitive.Credentials) {
 func (s *namesrvs) AddrList() []string {
        return s.srvs
 }
+
+// UpdateNameServerAddress will update srvs.
+// docs: https://rocketmq.apache.org/docs/best-practice-namesvr/
+func (s *namesrvs) UpdateNameServerAddress(nameServerDomain, instanceName 
string) {
+       if nameServerDomain == "" {
+               nameServerDomain = os.Getenv("NAMESRV_ADDR") // try to get from 
environment variable
 
 Review comment:
   The value from os.Getenv("NAMESRV_ADDR") is the real name server address, 
not a domain server. 
   it should not send a http request again.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to