You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2022/01/08 10:56:17 UTC

[GitHub] [servicecomb-service-center] xiaoluoluo opened a new pull request #1208: [feat] add datacenter info to instance from config

xiaoluoluo opened a new pull request #1208:
URL: https://github.com/apache/servicecomb-service-center/pull/1208


   【issue】#1207
   【修改内容】:config增加datacenter 信息,获取实例的时候读取配置信息 
   【修改原因】:获取实例接口增加datacenter 信息
   【影响范围】:无
   【额外说明】:无
   【测试用例】:无


-- 
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: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-service-center] tianxiaoliang commented on a change in pull request #1208: [feat] add datacenter info to instance from config

Posted by GitBox <gi...@apache.org>.
tianxiaoliang commented on a change in pull request #1208:
URL: https://github.com/apache/servicecomb-service-center/pull/1208#discussion_r780723802



##########
File path: server/config/config.go
##########
@@ -175,6 +175,10 @@ func loadServerConfig() ServerConfig {
 			GlobalVisible: GetString("registry.service.globalVisible", "", WithENV("CSE_SHARED_SERVICES")),
 			InstanceTTL:   GetInt64("registry.instance.ttl", 0, WithENV("INSTANCE_TTL")),
 
+			DataCenterName:          GetString("registry.instance.datacenter.name", "", WithENV("DATACENTER_NAME")),
+			DataCenterRegion:        GetString("registry.instance.datacenter.region", "", WithENV("DATACENTER_REGION")),

Review comment:
       不对,对象初始化都不合适,用archaius.Unmarshal就能一把反序列化了




-- 
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: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-service-center] little-cui commented on a change in pull request #1208: [feat] add datacenter info to instance from config

Posted by GitBox <gi...@apache.org>.
little-cui commented on a change in pull request #1208:
URL: https://github.com/apache/servicecomb-service-center/pull/1208#discussion_r780657403



##########
File path: etc/conf/app.yaml
##########
@@ -144,6 +144,10 @@ registry:
     # the allowable minimum value of instance heartbeat interval
     # if interval < minInterval, instance TTL still set with minInterval
     minInterval: 5s
+    datacenter:
+      name: dc1

Review comment:
       这些默认值都是空

##########
File path: server/config/config.go
##########
@@ -175,6 +175,10 @@ func loadServerConfig() ServerConfig {
 			GlobalVisible: GetString("registry.service.globalVisible", "", WithENV("CSE_SHARED_SERVICES")),
 			InstanceTTL:   GetInt64("registry.instance.ttl", 0, WithENV("INSTANCE_TTL")),
 
+			DataCenterName:          GetString("registry.instance.datacenter.name", "", WithENV("DATACENTER_NAME")),

Review comment:
       这些配置不是服务端配置,仅仅是实例注册的可选配置,不需要加到这个config中,在使用的地方直接config.GetString即可




-- 
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: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-service-center] tianxiaoliang commented on a change in pull request #1208: [feat] add datacenter info to instance from config

Posted by GitBox <gi...@apache.org>.
tianxiaoliang commented on a change in pull request #1208:
URL: https://github.com/apache/servicecomb-service-center/pull/1208#discussion_r780723802



##########
File path: server/config/config.go
##########
@@ -175,6 +175,10 @@ func loadServerConfig() ServerConfig {
 			GlobalVisible: GetString("registry.service.globalVisible", "", WithENV("CSE_SHARED_SERVICES")),
 			InstanceTTL:   GetInt64("registry.instance.ttl", 0, WithENV("INSTANCE_TTL")),
 
+			DataCenterName:          GetString("registry.instance.datacenter.name", "", WithENV("DATACENTER_NAME")),
+			DataCenterRegion:        GetString("registry.instance.datacenter.region", "", WithENV("DATACENTER_REGION")),

Review comment:
       这样做下去的坏处是我们要维护大量的代码 ,用archaius.Unmarshal就能一把反序列化了




-- 
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: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-service-center] tianxiaoliang merged pull request #1208: [feat] add datacenter info to instance from config

Posted by GitBox <gi...@apache.org>.
tianxiaoliang merged pull request #1208:
URL: https://github.com/apache/servicecomb-service-center/pull/1208


   


-- 
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: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org