[jira] [Commented] (SCB-474) 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。
[ https://issues.apache.org/jira/browse/SCB-474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16445230#comment-16445230 ] ASF GitHub Bot commented on SCB-474: liubao68 closed pull request #658: [SCB-474] add endpoint filter (only rest endpoints) for zuul integration URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/658 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/demo/demo-spring-boot-discovery/demo-spring-boot-discovery-server/src/main/resources/microservice.yaml b/demo/demo-spring-boot-discovery/demo-spring-boot-discovery-server/src/main/resources/microservice.yaml index 95d89ae36..1be593db4 100644 --- a/demo/demo-spring-boot-discovery/demo-spring-boot-discovery-server/src/main/resources/microservice.yaml +++ b/demo/demo-spring-boot-discovery/demo-spring-boot-discovery-server/src/main/resources/microservice.yaml @@ -25,6 +25,9 @@ cse: address: http://127.0.0.1:30100 rest: address: 0.0.0.0:8080 + #add highway for test filter + highway: +address: 0.0.0.0:7070 handler: chain: Provider: diff --git a/demo/demo-spring-boot-discovery/demo-spring-boot-zuul-proxy/src/test/java/org/apache/servicecomb/demo/discovery/zuul/DiscoveryZuulProxyIT.java b/demo/demo-spring-boot-discovery/demo-spring-boot-zuul-proxy/src/test/java/org/apache/servicecomb/demo/discovery/zuul/DiscoveryZuulProxyIT.java index 7de82872f..ed3a9631a 100644 --- a/demo/demo-spring-boot-discovery/demo-spring-boot-zuul-proxy/src/test/java/org/apache/servicecomb/demo/discovery/zuul/DiscoveryZuulProxyIT.java +++ b/demo/demo-spring-boot-discovery/demo-spring-boot-zuul-proxy/src/test/java/org/apache/servicecomb/demo/discovery/zuul/DiscoveryZuulProxyIT.java @@ -40,13 +40,16 @@ private TestRestTemplate restTemplate; @Test - public void getsRemoteServiceThroughGateway() throws Exception { -String response = restTemplate.getForObject( -"/gateway/greeting/sayhello/{name}", -String.class, -"Mike"); + public void getsRemoteServiceThroughGateway() { +//loop three time to insure only rest endpoint get +for (int i = 0; i < 3; i++) { + String response = restTemplate.getForObject( + "/gateway/greeting/sayhello/{name}", + String.class, + "Mike"); -assertThat(response).isEqualTo("hello Mike"); + assertThat(response).isEqualTo("hello Mike"); +} } @SpringBootApplication @@ -55,7 +58,7 @@ public void getsRemoteServiceThroughGateway() throws Exception { @EnableServiceComb static class DiscoveryZuulProxy { -public static void main(String[] args) throws Exception { +public static void main(String[] args) { SpringApplication.run(DiscoveryZuulProxy.class, args); } } diff --git a/samples/bmi/webapp/pom.xml b/samples/bmi/webapp/pom.xml index 4581ea358..23ae4fab2 100644 --- a/samples/bmi/webapp/pom.xml +++ b/samples/bmi/webapp/pom.xml @@ -33,6 +33,11 @@ org.springframework.boot spring-boot-starter + + + org.apache.servicecomb + transport-rest-vertx + org.apache.servicecomb spring-boot-starter-servicecomb diff --git a/spring-boot-starter/spring-boot-starter-discovery/src/main/java/org/apache/servicecomb/springboot/starter/discovery/CseRibbonEndpointDiscoveryFilter.java b/spring-boot-starter/spring-boot-starter-discovery/src/main/java/org/apache/servicecomb/springboot/starter/discovery/CseRibbonEndpointDiscoveryFilter.java new file mode 100644 index 0..65f72d7a3 --- /dev/null +++ b/spring-boot-starter/spring-boot-starter-discovery/src/main/java/org/apache/servicecomb/springboot/starter/discovery/CseRibbonEndpointDiscoveryFilter.java @@ -0,0 +1,45 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.servicecomb.springboot.starter.discovery; + +import org.apache.servicecomb.foundation.common.net.URIEndpointObject;
[jira] [Commented] (SCB-474) 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。
[ https://issues.apache.org/jira/browse/SCB-474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16445197#comment-16445197 ] ASF GitHub Bot commented on SCB-474: coveralls commented on issue #658: [SCB-474] add endpoint filter (only rest endpoints) for zuul integration URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/658#issuecomment-382350160 [![Coverage Status](https://coveralls.io/builds/16611492/badge)](https://coveralls.io/builds/16611492) Coverage increased (+0.04%) to 87.478% when pulling **8ad68fea89b144e856fef47e40dfd611c64360b3 on zhengyangyong:SCB-474** into **41049be9d9b41d32fbdf4e12f613d6e85ab21301 on apache:master**. This is an automated message from the Apache Git Service. To respond to the message, please log on 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 > 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。 > > > Key: SCB-474 > URL: https://issues.apache.org/jira/browse/SCB-474 > Project: Apache ServiceComb > Issue Type: Bug > Components: Java-Chassis >Affects Versions: java-chassis-1.0.0-m1 >Reporter: zhousujan >Assignee: yangyongzheng >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。经过定位,发现zuul能够把同一个微服务暴露的两种接入方式都获取到一个服务列表中,zuul默认使用轮询的方式进行路由,当轮询到rest方式时,能够正常调用;轮询到highway的地址时,必定报错。 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-474) 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。
[ https://issues.apache.org/jira/browse/SCB-474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16445147#comment-16445147 ] ASF GitHub Bot commented on SCB-474: zhengyangyong commented on a change in pull request #658: [SCB-474] add endpoint filter (only rest endpoints) for zuul integration URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/658#discussion_r182931277 ## File path: spring-boot-starter/spring-boot-starter-discovery/src/main/java/org/apache/servicecomb/springboot/starter/discovery/CseRibbonEndpointDiscoveryFilter.java ## @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.servicecomb.springboot.starter.discovery; + +import org.apache.servicecomb.core.filter.EndpointDiscoveryFilter; +import org.apache.servicecomb.serviceregistry.discovery.DiscoveryContext; +import org.apache.servicecomb.serviceregistry.discovery.DiscoveryTreeNode; + +public class CseRibbonEndpointDiscoveryFilter extends EndpointDiscoveryFilter { Review comment: Done This is an automated message from the Apache Git Service. To respond to the message, please log on 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 > 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。 > > > Key: SCB-474 > URL: https://issues.apache.org/jira/browse/SCB-474 > Project: Apache ServiceComb > Issue Type: Bug > Components: Java-Chassis >Affects Versions: java-chassis-1.0.0-m1 >Reporter: zhousujan >Assignee: yangyongzheng >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。经过定位,发现zuul能够把同一个微服务暴露的两种接入方式都获取到一个服务列表中,zuul默认使用轮询的方式进行路由,当轮询到rest方式时,能够正常调用;轮询到highway的地址时,必定报错。 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-474) 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。
[ https://issues.apache.org/jira/browse/SCB-474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16445148#comment-16445148 ] ASF GitHub Bot commented on SCB-474: zhengyangyong commented on a change in pull request #658: [SCB-474] add endpoint filter (only rest endpoints) for zuul integration URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/658#discussion_r182931282 ## File path: spring-boot-starter/spring-boot-starter-discovery/src/main/java/org/apache/servicecomb/springboot/starter/discovery/ServiceCombServerList.java ## @@ -49,13 +49,11 @@ public ServiceCombServerList() { RegistryUtils.getAppId(), serviceId, DefinitionConst.VERSION_RULE_ALL); -Map servers = serversVersionedCache.data(); -List instances = new ArrayList<>(servers.size()); -for (MicroserviceInstance s : servers.values()) { - for (String endpoint : s.getEndpoints()) { -URIEndpointObject uri = new URIEndpointObject(endpoint); -instances.add(new Server(uri.getHostOrIp(), uri.getPort())); - } +ArrayList endpoints = serversVersionedCache.data(); Review comment: Done This is an automated message from the Apache Git Service. To respond to the message, please log on 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 > 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。 > > > Key: SCB-474 > URL: https://issues.apache.org/jira/browse/SCB-474 > Project: Apache ServiceComb > Issue Type: Bug > Components: Java-Chassis >Affects Versions: java-chassis-1.0.0-m1 >Reporter: zhousujan >Assignee: yangyongzheng >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。经过定位,发现zuul能够把同一个微服务暴露的两种接入方式都获取到一个服务列表中,zuul默认使用轮询的方式进行路由,当轮询到rest方式时,能够正常调用;轮询到highway的地址时,必定报错。 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-474) 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。
[ https://issues.apache.org/jira/browse/SCB-474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16445149#comment-16445149 ] ASF GitHub Bot commented on SCB-474: zhengyangyong commented on a change in pull request #658: [SCB-474] add endpoint filter (only rest endpoints) for zuul integration URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/658#discussion_r182931334 ## File path: spring-boot-starter/spring-boot-starter-discovery/pom.xml ## @@ -73,7 +73,7 @@ org.apache.servicecomb - service-registry + java-chassis-core Review comment: Done,now CseRibbonEndpointDiscoveryFilter extend from AbstractEndpointDiscoveryFilter This is an automated message from the Apache Git Service. To respond to the message, please log on 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 > 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。 > > > Key: SCB-474 > URL: https://issues.apache.org/jira/browse/SCB-474 > Project: Apache ServiceComb > Issue Type: Bug > Components: Java-Chassis >Affects Versions: java-chassis-1.0.0-m1 >Reporter: zhousujan >Assignee: yangyongzheng >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。经过定位,发现zuul能够把同一个微服务暴露的两种接入方式都获取到一个服务列表中,zuul默认使用轮询的方式进行路由,当轮询到rest方式时,能够正常调用;轮询到highway的地址时,必定报错。 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-474) 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。
[ https://issues.apache.org/jira/browse/SCB-474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16444037#comment-16444037 ] ASF GitHub Bot commented on SCB-474: zhengyangyong commented on a change in pull request #658: [SCB-474] add endpoint filter (only rest endpoints) for zuul integration URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/658#discussion_r182740480 ## File path: spring-boot-starter/spring-boot-starter-discovery/src/main/java/org/apache/servicecomb/springboot/starter/discovery/ServiceCombServerList.java ## @@ -49,13 +49,11 @@ public ServiceCombServerList() { RegistryUtils.getAppId(), serviceId, DefinitionConst.VERSION_RULE_ALL); -Map servers = serversVersionedCache.data(); -List instances = new ArrayList<>(servers.size()); -for (MicroserviceInstance s : servers.values()) { - for (String endpoint : s.getEndpoints()) { -URIEndpointObject uri = new URIEndpointObject(endpoint); -instances.add(new Server(uri.getHostOrIp(), uri.getPort())); - } +ArrayList endpoints = serversVersionedCache.data(); Review comment: got it This is an automated message from the Apache Git Service. To respond to the message, please log on 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 > 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。 > > > Key: SCB-474 > URL: https://issues.apache.org/jira/browse/SCB-474 > Project: Apache ServiceComb > Issue Type: Bug > Components: Java-Chassis >Affects Versions: java-chassis-1.0.0-m1 >Reporter: zhousujan >Assignee: yangyongzheng >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。经过定位,发现zuul能够把同一个微服务暴露的两种接入方式都获取到一个服务列表中,zuul默认使用轮询的方式进行路由,当轮询到rest方式时,能够正常调用;轮询到highway的地址时,必定报错。 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-474) 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。
[ https://issues.apache.org/jira/browse/SCB-474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16444038#comment-16444038 ] ASF GitHub Bot commented on SCB-474: zhengyangyong commented on a change in pull request #658: [SCB-474] add endpoint filter (only rest endpoints) for zuul integration URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/658#discussion_r182739600 ## File path: spring-boot-starter/spring-boot-starter-discovery/src/main/java/org/apache/servicecomb/springboot/starter/discovery/CseRibbonEndpointDiscoveryFilter.java ## @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.servicecomb.springboot.starter.discovery; + +import org.apache.servicecomb.core.filter.EndpointDiscoveryFilter; +import org.apache.servicecomb.serviceregistry.discovery.DiscoveryContext; +import org.apache.servicecomb.serviceregistry.discovery.DiscoveryTreeNode; + +public class CseRibbonEndpointDiscoveryFilter extends EndpointDiscoveryFilter { Review comment: this package also have a set of "Cse.java" in it ,we may rename them by the way? This is an automated message from the Apache Git Service. To respond to the message, please log on 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 > 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。 > > > Key: SCB-474 > URL: https://issues.apache.org/jira/browse/SCB-474 > Project: Apache ServiceComb > Issue Type: Bug > Components: Java-Chassis >Affects Versions: java-chassis-1.0.0-m1 >Reporter: zhousujan >Assignee: yangyongzheng >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。经过定位,发现zuul能够把同一个微服务暴露的两种接入方式都获取到一个服务列表中,zuul默认使用轮询的方式进行路由,当轮询到rest方式时,能够正常调用;轮询到highway的地址时,必定报错。 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-474) 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。
[ https://issues.apache.org/jira/browse/SCB-474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16443644#comment-16443644 ] ASF GitHub Bot commented on SCB-474: wujimin commented on a change in pull request #658: [SCB-474] add endpoint filter (only rest endpoints) for zuul integration URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/658#discussion_r182439746 ## File path: spring-boot-starter/spring-boot-starter-discovery/src/main/java/org/apache/servicecomb/springboot/starter/discovery/ServiceCombServerList.java ## @@ -49,13 +49,11 @@ public ServiceCombServerList() { RegistryUtils.getAppId(), serviceId, DefinitionConst.VERSION_RULE_ALL); -Map servers = serversVersionedCache.data(); -List instances = new ArrayList<>(servers.size()); -for (MicroserviceInstance s : servers.values()) { - for (String endpoint : s.getEndpoints()) { -URIEndpointObject uri = new URIEndpointObject(endpoint); -instances.add(new Server(uri.getHostOrIp(), uri.getPort())); - } +ArrayList endpoints = serversVersionedCache.data(); Review comment: by previous comment, here will got `List`, not `List` This is an automated message from the Apache Git Service. To respond to the message, please log on 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 > 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。 > > > Key: SCB-474 > URL: https://issues.apache.org/jira/browse/SCB-474 > Project: Apache ServiceComb > Issue Type: Bug > Components: Java-Chassis >Affects Versions: java-chassis-1.0.0-m1 >Reporter: zhousujan >Assignee: yangyongzheng >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。经过定位,发现zuul能够把同一个微服务暴露的两种接入方式都获取到一个服务列表中,zuul默认使用轮询的方式进行路由,当轮询到rest方式时,能够正常调用;轮询到highway的地址时,必定报错。 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-474) 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。
[ https://issues.apache.org/jira/browse/SCB-474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16442669#comment-16442669 ] ASF GitHub Bot commented on SCB-474: WillemJiang commented on a change in pull request #658: [SCB-474] add endpoint filter (only rest endpoints) for zuul integration URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/658#discussion_r182465491 ## File path: spring-boot-starter/spring-boot-starter-discovery/src/main/java/org/apache/servicecomb/springboot/starter/discovery/CseRibbonEndpointDiscoveryFilter.java ## @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.servicecomb.springboot.starter.discovery; + +import org.apache.servicecomb.core.filter.EndpointDiscoveryFilter; +import org.apache.servicecomb.serviceregistry.discovery.DiscoveryContext; +import org.apache.servicecomb.serviceregistry.discovery.DiscoveryTreeNode; + +public class CseRibbonEndpointDiscoveryFilter extends EndpointDiscoveryFilter { Review comment: Cse is not supposed to be use here. This is an automated message from the Apache Git Service. To respond to the message, please log on 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 > 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。 > > > Key: SCB-474 > URL: https://issues.apache.org/jira/browse/SCB-474 > Project: Apache ServiceComb > Issue Type: Bug > Components: Java-Chassis >Affects Versions: java-chassis-1.0.0-m1 >Reporter: zhousujan >Assignee: yangyongzheng >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。经过定位,发现zuul能够把同一个微服务暴露的两种接入方式都获取到一个服务列表中,zuul默认使用轮询的方式进行路由,当轮询到rest方式时,能够正常调用;轮询到highway的地址时,必定报错。 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-474) 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。
[ https://issues.apache.org/jira/browse/SCB-474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16442564#comment-16442564 ] ASF GitHub Bot commented on SCB-474: wujimin commented on a change in pull request #658: [SCB-474] add endpoint filter (only rest endpoints) for zuul integration URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/658#discussion_r182439746 ## File path: spring-boot-starter/spring-boot-starter-discovery/src/main/java/org/apache/servicecomb/springboot/starter/discovery/ServiceCombServerList.java ## @@ -49,13 +49,11 @@ public ServiceCombServerList() { RegistryUtils.getAppId(), serviceId, DefinitionConst.VERSION_RULE_ALL); -Map servers = serversVersionedCache.data(); -List instances = new ArrayList<>(servers.size()); -for (MicroserviceInstance s : servers.values()) { - for (String endpoint : s.getEndpoints()) { -URIEndpointObject uri = new URIEndpointObject(endpoint); -instances.add(new Server(uri.getHostOrIp(), uri.getPort())); - } +ArrayList endpoints = serversVersionedCache.data(); Review comment: by previous comment, here will got List, not List This is an automated message from the Apache Git Service. To respond to the message, please log on 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 > 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。 > > > Key: SCB-474 > URL: https://issues.apache.org/jira/browse/SCB-474 > Project: Apache ServiceComb > Issue Type: Bug > Components: Java-Chassis >Affects Versions: java-chassis-1.0.0-m1 >Reporter: zhousujan >Assignee: yangyongzheng >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。经过定位,发现zuul能够把同一个微服务暴露的两种接入方式都获取到一个服务列表中,zuul默认使用轮询的方式进行路由,当轮询到rest方式时,能够正常调用;轮询到highway的地址时,必定报错。 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-474) 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。
[ https://issues.apache.org/jira/browse/SCB-474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16442562#comment-16442562 ] ASF GitHub Bot commented on SCB-474: wujimin commented on a change in pull request #658: [SCB-474] add endpoint filter (only rest endpoints) for zuul integration URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/658#discussion_r182439425 ## File path: spring-boot-starter/spring-boot-starter-discovery/src/main/java/org/apache/servicecomb/springboot/starter/discovery/CseRibbonEndpointDiscoveryFilter.java ## @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.servicecomb.springboot.starter.discovery; + +import org.apache.servicecomb.core.filter.EndpointDiscoveryFilter; +import org.apache.servicecomb.serviceregistry.discovery.DiscoveryContext; +import org.apache.servicecomb.serviceregistry.discovery.DiscoveryTreeNode; + +public class CseRibbonEndpointDiscoveryFilter extends EndpointDiscoveryFilter { Review comment: better extend from AbstractEndpointDiscoveryFilter and createEndpoint return com.netflix.loadbalancer.Server This is an automated message from the Apache Git Service. To respond to the message, please log on 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 > 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。 > > > Key: SCB-474 > URL: https://issues.apache.org/jira/browse/SCB-474 > Project: Apache ServiceComb > Issue Type: Bug > Components: Java-Chassis >Affects Versions: java-chassis-1.0.0-m1 >Reporter: zhousujan >Assignee: yangyongzheng >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。经过定位,发现zuul能够把同一个微服务暴露的两种接入方式都获取到一个服务列表中,zuul默认使用轮询的方式进行路由,当轮询到rest方式时,能够正常调用;轮询到highway的地址时,必定报错。 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-474) 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。
[ https://issues.apache.org/jira/browse/SCB-474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16442563#comment-16442563 ] ASF GitHub Bot commented on SCB-474: wujimin commented on a change in pull request #658: [SCB-474] add endpoint filter (only rest endpoints) for zuul integration URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/658#discussion_r182437916 ## File path: spring-boot-starter/spring-boot-starter-discovery/pom.xml ## @@ -73,7 +73,7 @@ org.apache.servicecomb - service-registry + java-chassis-core Review comment: why need change the dependency? This is an automated message from the Apache Git Service. To respond to the message, please log on 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 > 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。 > > > Key: SCB-474 > URL: https://issues.apache.org/jira/browse/SCB-474 > Project: Apache ServiceComb > Issue Type: Bug > Components: Java-Chassis >Affects Versions: java-chassis-1.0.0-m1 >Reporter: zhousujan >Assignee: yangyongzheng >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。经过定位,发现zuul能够把同一个微服务暴露的两种接入方式都获取到一个服务列表中,zuul默认使用轮询的方式进行路由,当轮询到rest方式时,能够正常调用;轮询到highway的地址时,必定报错。 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-474) 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。
[ https://issues.apache.org/jira/browse/SCB-474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16442301#comment-16442301 ] ASF GitHub Bot commented on SCB-474: coveralls commented on issue #658: [SCB-474] add endpoint filter (only rest endpoints) for zuul integration URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/658#issuecomment-382350160 [![Coverage Status](https://coveralls.io/builds/16574872/badge)](https://coveralls.io/builds/16574872) Coverage increased (+0.0007%) to 87.441% when pulling **bf9f0fe450d992355e9bae7f34b4a5fc358c0b74 on zhengyangyong:SCB-474** into **41049be9d9b41d32fbdf4e12f613d6e85ab21301 on apache:master**. This is an automated message from the Apache Git Service. To respond to the message, please log on 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 > 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。 > > > Key: SCB-474 > URL: https://issues.apache.org/jira/browse/SCB-474 > Project: Apache ServiceComb > Issue Type: Bug > Components: Java-Chassis >Affects Versions: java-chassis-1.0.0-m1 >Reporter: zhousujan >Assignee: yangyongzheng >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。经过定位,发现zuul能够把同一个微服务暴露的两种接入方式都获取到一个服务列表中,zuul默认使用轮询的方式进行路由,当轮询到rest方式时,能够正常调用;轮询到highway的地址时,必定报错。 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-474) 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。
[ https://issues.apache.org/jira/browse/SCB-474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16442241#comment-16442241 ] ASF GitHub Bot commented on SCB-474: zhengyangyong opened a new pull request #658: [SCB-474] add endpoint filter (only rest endpoints) for zuul integration URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/658 Signed-off-by: zhengyangyong Follow this checklist to help us incorporate your contribution quickly and easily: - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/SCB) filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes. - [ ] Each commit in the pull request should have a meaningful subject line and body. - [ ] Format the pull request title like `[SCB-XXX] Fixes bug in ApproximateQuantiles`, where you replace `SCB-XXX` with the appropriate JIRA issue. - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [ ] Run `mvn clean install` to make sure basic checks pass. A more thorough check will be performed on your pull request automatically. - [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf). --- Add rest filter for spring-cloud-zuul module in order to screen highway endpoints. only XML and Faceted project problem warnings ![image](https://user-images.githubusercontent.com/374335/38926660-0f1d886a-4336-11e8-9a45-505e8dbbed4f.png) This is an automated message from the Apache Git Service. To respond to the message, please log on 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 > 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。 > > > Key: SCB-474 > URL: https://issues.apache.org/jira/browse/SCB-474 > Project: Apache ServiceComb > Issue Type: Bug > Components: Java-Chassis >Affects Versions: java-chassis-1.0.0-m1 >Reporter: zhousujan >Assignee: yangyongzheng >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。经过定位,发现zuul能够把同一个微服务暴露的两种接入方式都获取到一个服务列表中,zuul默认使用轮询的方式进行路由,当轮询到rest方式时,能够正常调用;轮询到highway的地址时,必定报错。 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-474) 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。
[ https://issues.apache.org/jira/browse/SCB-474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16441960#comment-16441960 ] yangyongzheng commented on SCB-474: --- It seems need remove highway transport at producer side, not so good > 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。 > > > Key: SCB-474 > URL: https://issues.apache.org/jira/browse/SCB-474 > Project: Apache ServiceComb > Issue Type: Bug > Components: Java-Chassis >Affects Versions: java-chassis-1.0.0-m1 >Reporter: zhousujan >Assignee: yangyongzheng >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。经过定位,发现zuul能够把同一个微服务暴露的两种接入方式都获取到一个服务列表中,zuul默认使用轮询的方式进行路由,当轮询到rest方式时,能够正常调用;轮询到highway的地址时,必定报错。 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-474) 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。
[ https://issues.apache.org/jira/browse/SCB-474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16440311#comment-16440311 ] yangyongzheng commented on SCB-474: --- We need change dependencies of spring-cloud-zuul and remove highway transport > 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。 > > > Key: SCB-474 > URL: https://issues.apache.org/jira/browse/SCB-474 > Project: Apache ServiceComb > Issue Type: Bug > Components: Java-Chassis >Affects Versions: java-chassis-1.0.0-m1 >Reporter: zhousujan >Assignee: yangyongzheng >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。经过定位,发现zuul能够把同一个微服务暴露的两种接入方式都获取到一个服务列表中,zuul默认使用轮询的方式进行路由,当轮询到rest方式时,能够正常调用;轮询到highway的地址时,必定报错。 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-474) 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。
[ https://issues.apache.org/jira/browse/SCB-474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16433831#comment-16433831 ] Willem Jiang commented on SCB-474: -- [~zhengyangyong] Could you take a look at this issue? > 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。 > > > Key: SCB-474 > URL: https://issues.apache.org/jira/browse/SCB-474 > Project: Apache ServiceComb > Issue Type: Bug > Components: Java-Chassis >Affects Versions: java-chassis-1.0.0-m1 >Reporter: zhousujan >Assignee: yangyongzheng >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。经过定位,发现zuul能够把同一个微服务暴露的两种接入方式都获取到一个服务列表中,zuul默认使用轮询的方式进行路由,当轮询到rest方式时,能够正常调用;轮询到highway的地址时,必定报错。 -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SCB-474) 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。
[ https://issues.apache.org/jira/browse/SCB-474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16433581#comment-16433581 ] wujimin commented on SCB-474: - remove dependence from zuul project > 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。 > > > Key: SCB-474 > URL: https://issues.apache.org/jira/browse/SCB-474 > Project: Apache ServiceComb > Issue Type: Bug > Components: Java-Chassis >Affects Versions: java-chassis-1.0.0-m1 >Reporter: zhousujan >Priority: Major > Fix For: java-chassis-1.0.0-m2 > > > 使用zuul做网关进行路由,当同一个微服务接口同时开放rest和highway方式时,出现无法调用情况。经过定位,发现zuul能够把同一个微服务暴露的两种接入方式都获取到一个服务列表中,zuul默认使用轮询的方式进行路由,当轮询到rest方式时,能够正常调用;轮询到highway的地址时,必定报错。 -- This message was sent by Atlassian JIRA (v7.6.3#76005)