coolbeevip commented on a change in pull request #454: fix when server.port=0, 
health check fail and also fix lose consul metadata, such as 'secure=false'
URL: https://github.com/apache/servicecomb-pack/pull/454#discussion_r277138032
 
 

 ##########
 File path: 
alpha/alpha-spring-cloud-starter-consul/src/main/java/org/apache/servicecomb/pack/alpha/server/discovery/consul/AlphaConsulAutoConfiguration.java
 ##########
 @@ -114,7 +114,11 @@ public void 
listenInstanceRegisteredEvent(InstanceRegisteredEvent instanceRegist
             NewService newservice =  new NewService();
             newservice.setName(service.getServiceName());
             newservice.setId(service.getServiceId());
-            List<String> tags = consulDiscoveryProperties.getTags();
+            newservice.setAddress(service.getAddress());
+            newservice.setPort(service.getServicePort());
+            newservice.setMeta(service.getServiceMeta());
+
+            List<String> tags = service.getServiceTags();
 
 Review comment:
   Here you are right, Otherwise, we will lose the default tag, such as 
secure=false.
   
   With the `List<String> tags = service.getServiceTags();` , alpha send the 
following JSON data when we update the consul. 
   
   ```json
   {
        "ID": 
"servicecomb-alpha-server-0-0-0-0-e388eb111394660d63c2286c06ee78a6",
        "Name": "servicecomb-alpha-server",
        "Tags": ["alpha-server-host\u003d0.0.0.0", "secure\u003dfalse", 
"alpha-server-port\u003d8080"]
   }
   ```

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to