You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by ni...@apache.org on 2019/04/22 01:58:58 UTC
[servicecomb-pack] branch master updated: SCB-1264 fix lost consul
metadata, such as 'secure=false'
This is an automated email from the ASF dual-hosted git repository.
ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-pack.git
The following commit(s) were added to refs/heads/master by this push:
new 5a9d406 SCB-1264 fix lost consul metadata, such as 'secure=false'
5a9d406 is described below
commit 5a9d406eb7bf021d1cbcc97646e0a2a6c79573cd
Author: ryan xu <fe...@users.noreply.github.com>
AuthorDate: Sun Apr 21 16:06:30 2019 +0800
SCB-1264 fix lost consul metadata, such as 'secure=false'
fix when server.port=0, health check fail and also fix lose consul metadata, such as 'secure=false' (#454)
---
.../alpha/server/discovery/consul/AlphaConsulAutoConfiguration.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/alpha/alpha-spring-cloud-starter-consul/src/main/java/org/apache/servicecomb/pack/alpha/server/discovery/consul/AlphaConsulAutoConfiguration.java b/alpha/alpha-spring-cloud-starter-consul/src/main/java/org/apache/servicecomb/pack/alpha/server/discovery/consul/AlphaConsulAutoConfiguration.java
index 53351db..9bfaab4 100644
--- a/alpha/alpha-spring-cloud-starter-consul/src/main/java/org/apache/servicecomb/pack/alpha/server/discovery/consul/AlphaConsulAutoConfiguration.java
+++ b/alpha/alpha-spring-cloud-starter-consul/src/main/java/org/apache/servicecomb/pack/alpha/server/discovery/consul/AlphaConsulAutoConfiguration.java
@@ -114,7 +114,9 @@ public class AlphaConsulAutoConfiguration {
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());
+ List<String> tags = service.getServiceTags();
tags.remove("alpha-server-port=0");
tags.add("alpha-server-port="+actualAlphaServerPort);
newservice.setTags(tags);