[GitHub] [servicecomb-pack] fengbaicanhe commented on issue #454: fix when server.port=0, health check fail and also fix lose consul metadata, such as 'secure=false'

2019-04-20 Thread GitBox
fengbaicanhe commented on issue #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#issuecomment-485224894
 
 
   > > @WillemJiang @coolbeevip
   > > [after my 
explain](https://github.com/apache/servicecomb-pack/pull/454#discussion_r277152930),
 i think this solution will be better
   > > ```java
   > >   @EventListener
   > >   public void listenInstanceRegisteredEvent(InstanceRegisteredEvent 
instanceRegisteredEvent){
   > > if(alphaServerPort == 0){
   > >   if(instanceRegisteredEvent.getConfig() instanceof 
ConsulDiscoveryProperties){
   > > ConsulDiscoveryProperties properties = 
(ConsulDiscoveryProperties)instanceRegisteredEvent.getConfig();
   > > this.consuleInstanceId = 
formatConsulInstanceId(properties.getInstanceId());
   > > Response> services = 
consulClient.getCatalogService(serviceName,null);
   > > if(services.getValue() != null){
   > >   services.getValue().stream().filter(service ->
   > >   
service.getServiceId().equalsIgnoreCase(this.consuleInstanceId)).forEach(service
 -> {
   > > 
   > > NewService newservice =  new NewService();
   > > newservice.setName(service.getServiceName());
   > > newservice.setId(service.getServiceId());
   > > newservice.setAddress(service.getAddress());
   > > newservice.setPort(service.getServicePort());
   > > List tags = service.getServiceTags();
   > > tags.remove("alpha-server-port=0");
   > > tags.add("alpha-server-port="+actualAlphaServerPort);
   > > newservice.setTags(tags);
   > > consulClient.agentServiceRegister(newservice);
   > >   });
   > > }
   > >   }
   > > }
   > >   }
   > > ```
   > > 
   > > 
   > > it's only two lines more than @coolbeevip suggestion
   > > ```java
   > > newservice.setAddress(service.getAddress());
   > > newservice.setPort(service.getServicePort());
   > > ```
   > 
   > Looks good to me - Are you resubmitting your PR? :)
   
   @coolbeevip yes


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


[GitHub] [servicecomb-pack] coolbeevip commented on issue #454: fix when server.port=0, health check fail and also fix lose consul metadata, such as 'secure=false'

2019-04-20 Thread GitBox
coolbeevip commented on issue #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#issuecomment-485224507
 
 
   > @WillemJiang @coolbeevip
   > 
   > [after my 
explain](https://github.com/apache/servicecomb-pack/pull/454#discussion_r277152930),
 i think this solution will be better
   > 
   > ```java
   >   @EventListener
   >   public void listenInstanceRegisteredEvent(InstanceRegisteredEvent 
instanceRegisteredEvent){
   > if(alphaServerPort == 0){
   >   if(instanceRegisteredEvent.getConfig() instanceof 
ConsulDiscoveryProperties){
   > ConsulDiscoveryProperties properties = 
(ConsulDiscoveryProperties)instanceRegisteredEvent.getConfig();
   > this.consuleInstanceId = 
formatConsulInstanceId(properties.getInstanceId());
   > Response> services = 
consulClient.getCatalogService(serviceName,null);
   > if(services.getValue() != null){
   >   services.getValue().stream().filter(service ->
   >   
service.getServiceId().equalsIgnoreCase(this.consuleInstanceId)).forEach(service
 -> {
   > 
   > NewService newservice =  new NewService();
   > newservice.setName(service.getServiceName());
   > newservice.setId(service.getServiceId());
   > newservice.setAddress(service.getAddress());
   > newservice.setPort(service.getServicePort());
   > List tags = service.getServiceTags();
   > tags.remove("alpha-server-port=0");
   > tags.add("alpha-server-port="+actualAlphaServerPort);
   > newservice.setTags(tags);
   > consulClient.agentServiceRegister(newservice);
   >   });
   > }
   >   }
   > }
   >   }
   > ```
   > 
   > it's only two lines more than @coolbeevip suggestion
   > 
   > ```java
   > newservice.setAddress(service.getAddress());
   > newservice.setPort(service.getServicePort());
   > ```
   
   Looks good to me - Are you resubmitting your PR? :)


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


[GitHub] [servicecomb-pack] fengbaicanhe edited a comment on issue #454: fix when server.port=0, health check fail and also fix lose consul metadata, such as 'secure=false'

2019-04-20 Thread GitBox
fengbaicanhe edited a comment on issue #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#issuecomment-48549
 
 
   @WillemJiang  @coolbeevip 
   
   [after my 
explain](https://github.com/apache/servicecomb-pack/pull/454#discussion_r277152930),
 i think this solution will be better
   
   ```java
 @EventListener
 public void listenInstanceRegisteredEvent(InstanceRegisteredEvent 
instanceRegisteredEvent){
   if(alphaServerPort == 0){
 if(instanceRegisteredEvent.getConfig() instanceof 
ConsulDiscoveryProperties){
   ConsulDiscoveryProperties properties = 
(ConsulDiscoveryProperties)instanceRegisteredEvent.getConfig();
   this.consuleInstanceId = 
formatConsulInstanceId(properties.getInstanceId());
   Response> services = 
consulClient.getCatalogService(serviceName,null);
   if(services.getValue() != null){
 services.getValue().stream().filter(service ->
 
service.getServiceId().equalsIgnoreCase(this.consuleInstanceId)).forEach(service
 -> {
   
   NewService newservice =  new NewService();
   newservice.setName(service.getServiceName());
   newservice.setId(service.getServiceId());
   newservice.setAddress(service.getAddress());
   newservice.setPort(service.getServicePort());
   List tags = service.getServiceTags();
   tags.remove("alpha-server-port=0");
   tags.add("alpha-server-port="+actualAlphaServerPort);
   newservice.setTags(tags);
   consulClient.agentServiceRegister(newservice);
 });
   }
 }
   }
 }
   ```
   
   it's only two lines more than @coolbeevip suggestion
   ```java
   newservice.setAddress(service.getAddress());
   newservice.setPort(service.getServicePort());
   ```


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


[GitHub] [servicecomb-pack] fengbaicanhe commented on issue #454: fix when server.port=0, health check fail and also fix lose consul metadata, such as 'secure=false'

2019-04-20 Thread GitBox
fengbaicanhe commented on issue #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#issuecomment-48549
 
 
   @WillemJiang  @coolbeevip 
   
   after my explain, i think this solution will be better
   
   ```java
 @EventListener
 public void listenInstanceRegisteredEvent(InstanceRegisteredEvent 
instanceRegisteredEvent){
   if(alphaServerPort == 0){
 if(instanceRegisteredEvent.getConfig() instanceof 
ConsulDiscoveryProperties){
   ConsulDiscoveryProperties properties = 
(ConsulDiscoveryProperties)instanceRegisteredEvent.getConfig();
   this.consuleInstanceId = 
formatConsulInstanceId(properties.getInstanceId());
   Response> services = 
consulClient.getCatalogService(serviceName,null);
   if(services.getValue() != null){
 services.getValue().stream().filter(service ->
 
service.getServiceId().equalsIgnoreCase(this.consuleInstanceId)).forEach(service
 -> {
   
   NewService newservice =  new NewService();
   newservice.setName(service.getServiceName());
   newservice.setId(service.getServiceId());
   newservice.setAddress(service.getAddress());
   newservice.setPort(service.getServicePort());
   List tags = service.getServiceTags();
   tags.remove("alpha-server-port=0");
   tags.add("alpha-server-port="+actualAlphaServerPort);
   newservice.setTags(tags);
   consulClient.agentServiceRegister(newservice);
 });
   }
 }
   }
 }
   ```
   
   it's only two lines more than @coolbeevip suggestion
   ```java
   newservice.setAddress(service.getAddress());
   newservice.setPort(service.getServicePort());
   ```


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


[GitHub] [servicecomb-pack] fengbaicanhe 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'

2019-04-20 Thread GitBox
fengbaicanhe 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_r277151320
 
 

 ##
 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 tags = consulDiscoveryProperties.getTags();
+newservice.setAddress(service.getAddress());
 
 Review comment:
   ~~I think so, the  IP address is no need to change~~ [see 
blow](https://github.com/apache/servicecomb-pack/pull/454#discussion_r277152930)


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


[GitHub] [servicecomb-pack] fengbaicanhe 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'

2019-04-20 Thread GitBox
fengbaicanhe 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_r277151320
 
 

 ##
 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 tags = consulDiscoveryProperties.getTags();
+newservice.setAddress(service.getAddress());
 
 Review comment:
   ~~I think so, the  IP address is no need to change~~


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


[GitHub] [servicecomb-pack] fengbaicanhe 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'

2019-04-20 Thread GitBox
fengbaicanhe 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_r277152930
 
 

 ##
 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 tags = consulDiscoveryProperties.getTags();
+newservice.setAddress(service.getAddress());
+newservice.setPort(service.getServicePort());
 
 Review comment:
   [As i describe my development environment 
above](https://github.com/apache/servicecomb-pack/pull/454#discussion_r277151707),
 the port will be updated to '0' after call method 
   ```java
   @EventListener
   public void listenInstanceRegisteredEvent(InstanceRegisteredEvent 
instanceRegisteredEvent)
   ```
   
   I know when project startup, when set server.port=0, 
   
   - spring will generate a random port like 56701
   - then spring use this port registered to consul,
   - after service registered, spring will publish a `InstanceRegisteredEvent`  
event
   
   and alpha server subscribe the event, re-register service instance with 
`alpha-server-port` and `alpha-server-host` tags while alphaServerPort is set 
to zero
   
   I think the problem is `NewService newservice =  new NewService();` **after 
this line, the default health check host and port will be set to null**
   
   and in actually register code in blow
   ```java
@Override
public Response agentServiceRegister(NewService newService, 
String token) {
UrlParameters tokenParam = token != null ? new 
SingleUrlParameters("token", token) : null;
   
String json = GsonFactory.getGson().toJson(newService);
RawResponse rawResponse = 
rawClient.makePutRequest("/v1/agent/service/register", json, tokenParam);
   
if (rawResponse.getStatusCode() == 200) {
return new Response(null, rawResponse);
} else {
throw new OperationException(rawResponse);
}
}
   ```
   it only serialize `newService` to json, and **the serialization only include 
non-null value**, so the health check host and port lost
   
   So re-think about this problem, I think the host and port should be set to 
`newService` is necessary
   


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


[GitHub] [servicecomb-java-chassis] coveralls edited a comment on issue #1187: [SCB-1260] Fix swagger online test for servlet

2019-04-20 Thread GitBox
coveralls edited a comment on issue #1187: [SCB-1260] Fix swagger online test 
for servlet
URL: 
https://github.com/apache/servicecomb-java-chassis/pull/1187#issuecomment-485045907
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/22931991/badge)](https://coveralls.io/builds/22931991)
   
   Coverage increased (+0.009%) to 85.749% when pulling 
**d9b72879456193fc95113429701a90582b8d098b on 
wujimin:fix-swagger-online-test-for-servlet** into 
**dd685837c7fd37f818747c8f014a89d0d7f7e308 on apache:master**.
   


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


[GitHub] [servicecomb-pack] fengbaicanhe 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'

2019-04-20 Thread GitBox
fengbaicanhe 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_r277151707
 
 

 ##
 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 tags = consulDiscoveryProperties.getTags();
+newservice.setAddress(service.getAddress());
 
 Review comment:
   Sorry about i do not describe my develop environment clearly, and I am sorry 
for submitting the code without doing a full test( only tested in below 
environment ).
   
   **version details:** 
   
   > spring boot version: 2.1.4.RELEASE
   > spring-cloud-starter-consul version: 2.1.1.RELEASE
   > consul version: 1.4.4
   > alpha server version: 0.4.0
   
   **application.properties**
   
   > server.port=0
   > alpha.server.host=0.0.0.0
   > alpha.server.port=0
   > alpha.server.initialPort=34500
   
   **One more should be attention**
   I **use alpha server as a dependency** in my spring boot project
   
   I use 
[spring-boot-admin-server](https://github.com/codecentric/spring-boot-admin) 
for service health monitor
   
   As mentioned above, if `newservice.setPort(service.getServicePort());` this 
line is missing, consul will register service's health check port as 0, and 
this will cause health check fails


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


[GitHub] [servicecomb-pack] fengbaicanhe 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'

2019-04-20 Thread GitBox
fengbaicanhe 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_r277151320
 
 

 ##
 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 tags = consulDiscoveryProperties.getTags();
+newservice.setAddress(service.getAddress());
 
 Review comment:
   I think so, the  IP address is no need to change


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


[GitHub] [servicecomb-pack] fengbaicanhe 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'

2019-04-20 Thread GitBox
fengbaicanhe 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_r277151319
 
 

 ##
 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 tags = consulDiscoveryProperties.getTags();
+newservice.setAddress(service.getAddress());
+newservice.setPort(service.getServicePort());
+newservice.setMeta(service.getServiceMeta());
 
 Review comment:
   As you know, **Spring Cloud Consul uses Consul tags to approximate metadata 
until Consul officially supports metadata.** 
   ```
   newservice.setMeta(service.getServiceMeta());
   ```
   this line i committed is useless, it should be remove


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


[GitHub] [servicecomb-java-chassis] wujimin opened a new pull request #1187: [SCB-1260] Fix swagger online test for servlet

2019-04-20 Thread GitBox
wujimin opened a new pull request #1187: [SCB-1260] Fix swagger online test for 
servlet
URL: https://github.com/apache/servicecomb-java-chassis/pull/1187
 
 
   


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


[GitHub] [servicecomb-java-chassis] wujimin closed pull request #1187: [SCB-1260] Fix swagger online test for servlet

2019-04-20 Thread GitBox
wujimin closed pull request #1187: [SCB-1260] Fix swagger online test for 
servlet
URL: https://github.com/apache/servicecomb-java-chassis/pull/1187
 
 
   


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


[GitHub] [servicecomb-java-chassis] coveralls commented on issue #1189: [SCB-1259] Optional as response type

2019-04-20 Thread GitBox
coveralls commented on issue #1189: [SCB-1259] Optional as response type
URL: 
https://github.com/apache/servicecomb-java-chassis/pull/1189#issuecomment-485149592
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/22929321/badge)](https://coveralls.io/builds/22929321)
   
   Coverage decreased (-0.05%) to 85.691% when pulling 
**3cbe24670a483f4670c9c9af4848c057d3b65990 on 
wujimin:Optional-as-response-type** into 
**dd685837c7fd37f818747c8f014a89d0d7f7e308 on apache:master**.
   


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


[servicecomb-java-chassis] branch master updated: [SCB-1088] SDK IsolationServerEvent is missing endpoint information

2019-04-20 Thread wujimin
This is an automated email from the ASF dual-hosted git repository.

wujimin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-java-chassis.git


The following commit(s) were added to refs/heads/master by this push:
 new c957fc3  [SCB-1088] SDK IsolationServerEvent is missing endpoint 
information
c957fc3 is described below

commit c957fc3cce598c05665d5aedb858577f19978e4e
Author: heyile <2513931...@qq.com>
AuthorDate: Sat Apr 20 11:49:03 2019 +0800

[SCB-1088] SDK IsolationServerEvent is missing endpoint information
---
 .../loadbalance/event/IsolationServerEvent.java|   4 +-
 .../filter/IsolationDiscoveryFilter.java   |   9 +-
 .../loadbalance/TestLoadBalanceHandler2.java   | 101 +
 3 files changed, 106 insertions(+), 8 deletions(-)

diff --git 
a/handlers/handler-loadbalance/src/main/java/org/apache/servicecomb/loadbalance/event/IsolationServerEvent.java
 
b/handlers/handler-loadbalance/src/main/java/org/apache/servicecomb/loadbalance/event/IsolationServerEvent.java
index 3c1cb22..a48e6d4 100644
--- 
a/handlers/handler-loadbalance/src/main/java/org/apache/servicecomb/loadbalance/event/IsolationServerEvent.java
+++ 
b/handlers/handler-loadbalance/src/main/java/org/apache/servicecomb/loadbalance/event/IsolationServerEvent.java
@@ -52,10 +52,10 @@ public class IsolationServerEvent extends AlarmEvent {
 
   public IsolationServerEvent(Invocation invocation, MicroserviceInstance 
instance,
   ServiceCombServerStats serverStats,
-  IsolationDiscoveryFilter.Settings settings, Type type) {
+  IsolationDiscoveryFilter.Settings settings, Type type, Endpoint 
endpoint) {
 super(type);
 this.microserviceName = invocation.getMicroserviceName();
-this.endpoint = invocation.getEndpoint();
+this.endpoint = endpoint;
 this.currentTotalRequest = serverStats.getTotalRequests();
 this.currentCountinuousFailureCount = 
serverStats.getCountinuousFailureCount();
 this.currentErrorPercentage = serverStats.getFailedRate();
diff --git 
a/handlers/handler-loadbalance/src/main/java/org/apache/servicecomb/loadbalance/filter/IsolationDiscoveryFilter.java
 
b/handlers/handler-loadbalance/src/main/java/org/apache/servicecomb/loadbalance/filter/IsolationDiscoveryFilter.java
index c1bb516..4328d73 100644
--- 
a/handlers/handler-loadbalance/src/main/java/org/apache/servicecomb/loadbalance/filter/IsolationDiscoveryFilter.java
+++ 
b/handlers/handler-loadbalance/src/main/java/org/apache/servicecomb/loadbalance/filter/IsolationDiscoveryFilter.java
@@ -152,7 +152,7 @@ public class IsolationDiscoveryFilter implements 
DiscoveryFilter {
 ServiceCombLoadBalancerStats.INSTANCE.markIsolated(server, true);
 eventBus.post(
 new IsolationServerEvent(invocation, instance, serverStats,
-settings, Type.OPEN));
+settings, Type.OPEN, server.getEndpoint()));
 LOGGER.warn("Isolate service {}'s instance {}.", 
invocation.getMicroserviceName(),
 instance.getInstanceId());
   }
@@ -166,7 +166,7 @@ public class IsolationDiscoveryFilter implements 
DiscoveryFilter {
   }
   ServiceCombLoadBalancerStats.INSTANCE.markIsolated(server, false);
   eventBus.post(new IsolationServerEvent(invocation, instance, serverStats,
-  settings, Type.CLOSE));
+  settings, Type.CLOSE, server.getEndpoint()));
   LOGGER.warn("Recover service {}'s instance {} from isolation.", 
invocation.getMicroserviceName(),
   instance.getInstanceId());
 }
@@ -188,9 +188,6 @@ public class IsolationDiscoveryFilter implements 
DiscoveryFilter {
 if (settings.errorThresholdPercentage == 0) {
   return true;
 }
-if (serverStats.getFailedRate() >= settings.errorThresholdPercentage) {
-  return false;
-}
-return true;
+return serverStats.getFailedRate() < settings.errorThresholdPercentage;
   }
 }
diff --git 
a/handlers/handler-loadbalance/src/test/java/org/apache/servicecomb/loadbalance/TestLoadBalanceHandler2.java
 
b/handlers/handler-loadbalance/src/test/java/org/apache/servicecomb/loadbalance/TestLoadBalanceHandler2.java
index 2c2c7db..f0e3ad5 100644
--- 
a/handlers/handler-loadbalance/src/test/java/org/apache/servicecomb/loadbalance/TestLoadBalanceHandler2.java
+++ 
b/handlers/handler-loadbalance/src/test/java/org/apache/servicecomb/loadbalance/TestLoadBalanceHandler2.java
@@ -20,11 +20,14 @@ package org.apache.servicecomb.loadbalance;
 import static org.mockito.Mockito.when;
 
 import java.util.ArrayList;
+import java.util.EventListener;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.TimeUnit;
 
+import javax.xml.ws.Holder;
+
 import org.apache.servicecomb.core.CseContext;
 import org.apache.servicecomb.core.Invocation;
 import org.apache.servicecomb.core.NonSwaggerInvocation;
@@ -35,7 +38,9 @@ import org.apache.servicecomb.core.definition.OperationMeta;
 

[GitHub] [servicecomb-java-chassis] wujimin opened a new pull request #1189: [SCB-1259] Optional as response type

2019-04-20 Thread GitBox
wujimin opened a new pull request #1189: [SCB-1259] Optional as response type
URL: https://github.com/apache/servicecomb-java-chassis/pull/1189
 
 
   


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


[GitHub] [servicecomb-pack] coolbeevip commented on issue #454: fix when server.port=0, health check fail and also fix lose consul metadata, such as 'secure=false'

2019-04-20 Thread GitBox
coolbeevip commented on issue #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#issuecomment-485140601
 
 
   @fengbaicanhe @WillemJiang 
   
   I suggest to modify it as follows
   
   ```java
 @EventListener
 public void listenInstanceRegisteredEvent(InstanceRegisteredEvent 
instanceRegisteredEvent){
   if(alphaServerPort == 0){
 if(instanceRegisteredEvent.getConfig() instanceof 
ConsulDiscoveryProperties){
   ConsulDiscoveryProperties properties = 
(ConsulDiscoveryProperties)instanceRegisteredEvent.getConfig();
   this.consuleInstanceId = 
formatConsulInstanceId(properties.getInstanceId());
   Response> services = 
consulClient.getCatalogService(serviceName,null);
   if(services.getValue() != null){
 services.getValue().stream().filter(service ->
 
service.getServiceId().equalsIgnoreCase(this.consuleInstanceId)).forEach(service
 -> {
   
   NewService newservice =  new NewService();
   newservice.setName(service.getServiceName());
   newservice.setId(service.getServiceId());
   List tags = service.getServiceTags();
   tags.remove("alpha-server-port=0");
   tags.add("alpha-server-port="+actualAlphaServerPort);
   newservice.setTags(tags);
   consulClient.agentServiceRegister(newservice);
 });
   }
 }
   }
 }
   ```


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


[GitHub] [servicecomb-pack] 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'

2019-04-20 Thread GitBox
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_r277139427
 
 

 ##
 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 tags = consulDiscoveryProperties.getTags();
+newservice.setAddress(service.getAddress());
+newservice.setPort(service.getServicePort());
+newservice.setMeta(service.getServiceMeta());
 
 Review comment:
   @fengbaicanhe 
   I am not sure how to configure the consul meta parameter using spring cloud 
consul, Because I saw the following description on the 
https://cloud.spring.io/spring-cloud-consul/spring-cloud-consul.html#_metadata_and_consul_tags
   
   > Consul does not yet support metadata on services. Spring Cloud’s 
ServiceInstance has a Map metadata field. Spring Cloud Consul 
uses Consul tags to approximate metadata until Consul officially supports 
metadata. Tags with the form key=value will be split and used as a Map key and 
value respectively. Tags without the equal = sign, will be used as both the key 
and value.
   
   Spring cloud consul uses the Consul Java API 
https://github.com/Ecwid/consul-api. Although the setMeta method is provided in 
the NewService class, spring cloud consul does not use this method, you can see 
it in the registration method of the ConsulAutoRegistration class of the 
spring-cloud-consul-discovery-2.1.1.RELEASE.jar
   
   ```java
 public static ConsulAutoRegistration 
registration(AutoServiceRegistrationProperties 
autoServiceRegistrationProperties, ConsulDiscoveryProperties properties, 
ApplicationContext context, List 
registrationCustomizers, List 
managementRegistrationCustomizers, HeartbeatProperties heartbeatProperties) {
   NewService service = new NewService();
   String appName = getAppName(properties, context.getEnvironment());
   service.setId(getInstanceId(properties, context));
   if (!properties.isPreferAgentAddress()) {
 service.setAddress(properties.getHostname());
   }
   
   service.setName(normalizeForDns(appName));
   service.setTags(createTags(properties));
   if (properties.getPort() != null) {
 service.setPort(properties.getPort());
 setCheck(service, autoServiceRegistrationProperties, properties, 
context, heartbeatProperties);
   }
   
   ConsulAutoRegistration registration = new 
ConsulAutoRegistration(service, autoServiceRegistrationProperties, properties, 
context, heartbeatProperties, managementRegistrationCustomizers);
   customize(registrationCustomizers, registration);
   return registration;
 }
   ```
   Do you have any suggestions about consul's meta?


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


[GitHub] [servicecomb-pack] 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'

2019-04-20 Thread GitBox
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 tags = consulDiscoveryProperties.getTags();
+newservice.setAddress(service.getAddress());
+newservice.setPort(service.getServicePort());
+newservice.setMeta(service.getServiceMeta());
+
+List tags = service.getServiceTags();
 
 Review comment:
   Here you are right, Otherwise, we will lose the default tag, such as 
secure=false.
   
   With the `List 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


[GitHub] [servicecomb-pack] 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'

2019-04-20 Thread GitBox
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 tags = consulDiscoveryProperties.getTags();
+newservice.setAddress(service.getAddress());
+newservice.setPort(service.getServicePort());
+newservice.setMeta(service.getServiceMeta());
+
+List tags = service.getServiceTags();
 
 Review comment:
   Here you are right, Otherwise, we will lose the default tag, such as 
secure=false.
   
   With the `List tags = service.getServiceTags();` , we send the 
following JSON data when we update the consul. 
   {
"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"],
"Port": 56701
   }


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


[GitHub] [servicecomb-pack] 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'

2019-04-20 Thread GitBox
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 tags = consulDiscoveryProperties.getTags();
+newservice.setAddress(service.getAddress());
+newservice.setPort(service.getServicePort());
+newservice.setMeta(service.getServiceMeta());
+
+List tags = service.getServiceTags();
 
 Review comment:
   Here you are right, Otherwise, we will lose the default tag, such as 
secure=false.
   
   With the `List tags = service.getServiceTags();` , we 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"],
"Port": 56701
   }
   ```


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


[GitHub] [servicecomb-pack] 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'

2019-04-20 Thread GitBox
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 tags = consulDiscoveryProperties.getTags();
+newservice.setAddress(service.getAddress());
+newservice.setPort(service.getServicePort());
+newservice.setMeta(service.getServiceMeta());
+
+List tags = service.getServiceTags();
 
 Review comment:
   Here you are right, Otherwise, we will lose the default tag, such as 
secure=false.
   
   With the `List 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"],
"Port": 56701
   }
   ```


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


[GitHub] [servicecomb-pack] 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'

2019-04-20 Thread GitBox
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_r277137844
 
 

 ##
 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 tags = consulDiscoveryProperties.getTags();
+newservice.setAddress(service.getAddress());
+newservice.setPort(service.getServicePort());
 
 Review comment:
   The first time alpha registered the consul, alpha already used the random 
port, so you don't need to update it. You can see this json data in the 
agentServiceRegister method of AgentConsulClient class
   
   ```java
 public Response agentServiceRegister(NewService newService, String 
token) {
   UrlParameters tokenParam = token != null ? new 
SingleUrlParameters("token", token) : null;
   String json = GsonFactory.getGson().toJson(newService);
   RawResponse rawResponse = 
this.rawClient.makePutRequest("/v1/agent/service/register", json, new 
UrlParameters[]{tokenParam});
   if (rawResponse.getStatusCode() == 200) {
 return new Response((Object)null, rawResponse);
   } else {
 throw new OperationException(rawResponse);
   }
 }
   ```
   
   If you configure server.port=0 when you start alpha, you can see the 
following data, 56701 is a randomly generated port
   
   ```json
   {
"ID": 
"servicecomb-alpha-server-0-0-0-0-e388eb111394660d63c2286c06ee78a6",
"Name": "servicecomb-alpha-server",
"Tags": ["alpha-server-host\u003d0.0.0.0", "alpha-server-port\u003d0", 
"secure\u003dfalse"],
"Address": "192.168.1.102",
"Port": 56701,
"Check": {
"Interval": "10s",
"HTTP": "http://192.168.1.102:56701/actuator/health;,
"Header": {}
}
   }
   ```


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


[GitHub] [servicecomb-pack] 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'

2019-04-20 Thread GitBox
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_r277137677
 
 

 ##
 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 tags = consulDiscoveryProperties.getTags();
+newservice.setAddress(service.getAddress());
 
 Review comment:
   We don't need to update the IP address because it doesn't change


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


[GitHub] [servicecomb-pack] coolbeevip edited a comment on issue #454: fix when server.port=0, health check fail and also fix lose consul metadata, such as 'secure=false'

2019-04-20 Thread GitBox
coolbeevip edited a comment on issue #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#issuecomment-485131986
 
 
   @fengbaicanhe Thank you for the problem you found.
   What version are you using consul? Did you set the server.port=0 and 
alpha.server.port=0 parameters at the same time? can you show me all the 
startup parameters of alpha?
   
   Method getServiceMeta class NewService is a new method in version consul-api 
1.4.1, It is not compatible with version consul-api 1.3.0.
   We hope that users can choose the spring cloud 1.x or 2.x, so alpha 
dependences spring-cloud-starter-consul 2.1.1 and spring-cloud-starter-consul 
1.3.5
   
   spring-cloud-starter-consul 2.1.1. RELEASE dependence consul-api 1.4.1
   spring-cloud-starter-consul 1.3.5. RELEASE dependence consul-api 1.3.0
   


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


[GitHub] [servicecomb-pack] coolbeevip edited a comment on issue #454: fix when server.port=0, health check fail and also fix lose consul metadata, such as 'secure=false'

2019-04-20 Thread GitBox
coolbeevip edited a comment on issue #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#issuecomment-485131986
 
 
   @fengbaicanhe Thank you for the problem you found.
   What version are you using consul? can you show me all the startup 
parameters of alpha?
   
   Method getServiceMeta class NewService is a new method in version consul-api 
1.4.1, It is not compatible with version consul-api 1.3.0.
   We hope that users can choose the spring cloud 1.x or 2.x, so alpha 
dependences spring-cloud-starter-consul 2.1.1 and spring-cloud-starter-consul 
1.3.5
   
   spring-cloud-starter-consul 2.1.1. RELEASE dependence consul-api 1.4.1
   spring-cloud-starter-consul 1.3.5. RELEASE dependence consul-api 1.3.0
   


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


[GitHub] [servicecomb-pack] coolbeevip edited a comment on issue #454: fix when server.port=0, health check fail and also fix lose consul metadata, such as 'secure=false'

2019-04-20 Thread GitBox
coolbeevip edited a comment on issue #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#issuecomment-485131986
 
 
   @fengbaicanhe Thank you for the problem you found.
   Can you show me all the startup parameters of alpha?
   
   Method getServiceMeta class NewService is a new method in version consul-api 
1.4.1, It is not compatible with version consul-api 1.3.0.
   We hope that users can choose the spring cloud 1.x or 2.x, so alpha 
dependences spring-cloud-starter-consul 2.1.1 and spring-cloud-starter-consul 
1.3.5
   
   spring-cloud-starter-consul 2.1.1. RELEASE dependence consul-api 1.4.1
   spring-cloud-starter-consul 1.3.5. RELEASE dependence consul-api 1.3.0
   


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


[GitHub] [servicecomb-pack] coolbeevip commented on issue #454: fix when server.port=0, health check fail and also fix lose consul metadata, such as 'secure=false'

2019-04-20 Thread GitBox
coolbeevip commented on issue #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#issuecomment-485131986
 
 
   @fengbaicanhe Thank you for the problem you found.
   I think this problem only happens when setting alpha.server.port=0, can you 
be sure that the problem happens when server.port=0?
   Can you show me all the startup parameters of alpha?
   
   Method getServiceMeta class NewService is a new method in version consul-api 
1.4.1, It is not compatible with version consul-api 1.3.0.
   We hope that users can choose the spring cloud 1.x or 2.x, so alpha 
dependences spring-cloud-starter-consul 2.1.1 and spring-cloud-starter-consul 
1.3.5
   
   spring-cloud-starter-consul 2.1.1. RELEASE dependence consul-api 1.4.1
   spring-cloud-starter-consul 1.3.5. RELEASE dependence consul-api 1.3.0
   


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


[GitHub] [servicecomb-java-chassis] willard-kali edited a comment on issue #1126: edge如何转发请求给非servicecomb服务?如何扩展接入其他服务注册中心?

2019-04-20 Thread GitBox
willard-kali edited a comment on issue #1126: 
edge如何转发请求给非servicecomb服务?如何扩展接入其他服务注册中心?
URL: 
https://github.com/apache/servicecomb-java-chassis/issues/1126#issuecomment-485079292
 
 
   如果需要在UI转发(httpClientRequest)之前,需要增加鉴权认证逻辑,请问如何能够实现?
   我自己尝试了CseAsyncRestTemplate调用微服务并创建异步监听,监听成功的处理流程中进行http请求转发,然而却卡在了
   `context.request().handler(d -> {
   clientRequest.write(d);
   data = d;
   });`
   这步不能继续执行。


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


[GitHub] [servicecomb-java-chassis] willard-kali commented on issue #1126: edge如何转发请求给非servicecomb服务?如何扩展接入其他服务注册中心?

2019-04-20 Thread GitBox
willard-kali commented on issue #1126: edge如何转发请求给非servicecomb服务?如何扩展接入其他服务注册中心?
URL: 
https://github.com/apache/servicecomb-java-chassis/issues/1126#issuecomment-485079292
 
 
   如果需要在UI转发(httpClientRequest)之前,需要增加鉴权认证逻辑,请问如何能够实现?
   我自己尝试了CseAsyncRestTemplate调用微服务并创建异步监听,监听成功的处理流程中进行http请求转发,然而却卡在了


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


[GitHub] [servicecomb-pack] 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'

2019-04-20 Thread GitBox
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_r277126081
 
 

 ##
 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 tags = consulDiscoveryProperties.getTags();
+newservice.setAddress(service.getAddress());
+newservice.setPort(service.getServicePort());
+newservice.setMeta(service.getServiceMeta());
 
 Review comment:
   Ok, I will look at this question later today.


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


[GitHub] [servicecomb-pack] WillemJiang 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'

2019-04-20 Thread GitBox
WillemJiang 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_r277125643
 
 

 ##
 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 tags = consulDiscoveryProperties.getTags();
+newservice.setAddress(service.getAddress());
+newservice.setPort(service.getServicePort());
+newservice.setMeta(service.getServiceMeta());
 
 Review comment:
   @fengbaicanhe  Thanks for the PR. When building with Spring-Boot 1.5.x, the 
CI got below error.
   
   
/home/travis/build/apache/servicecomb-pack/alpha/alpha-spring-cloud-starter-consul/src/main/java/org/apache/servicecomb/pack/alpha/server/discovery/consul/AlphaConsulAutoConfiguration.java:[119,39]
 cannot find symbol
 symbol:   method getServiceMeta()
 location: variable service of type 
com.ecwid.consul.v1.catalog.model.CatalogService
   
   @coolbeevip  Could you take a look at this?


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