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 2019/12/18 07:05:31 UTC

[GitHub] [rocketmq-client-go] twz915 commented on a change in pull request #315: [ISSUE #314] support name server domain

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

 ##########
 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:
   ok, i'll fix 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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services