You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2021/05/06 12:34:15 UTC

[GitHub] [servicecomb-java-chassis] Riiiiicher opened a new issue #2366: 如何根据微服务的服务名获取到对应服务的实例信息呢?

Riiiiicher opened a new issue #2366:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2366


   


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



[GitHub] [servicecomb-java-chassis] Riiiiicher closed issue #2366: 如何根据微服务的服务名获取到对应服务的实例信息呢?

Posted by GitBox <gi...@apache.org>.
Riiiiicher closed issue #2366:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2366


   


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



[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #2366: 如何根据微服务的服务名获取到对应服务的实例信息呢?

Posted by GitBox <gi...@apache.org>.
liubao68 commented on issue #2366:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2366#issuecomment-834043076


   你的应用场景是什么样的?这个过程在微服务调用是自动完成的。 所以没有外部API, 看源码是可以了解到具体工作工程的。 


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



[GitHub] [servicecomb-java-chassis] Riiiiicher commented on issue #2366: 如何根据微服务的服务名获取到对应服务的实例信息呢?

Posted by GitBox <gi...@apache.org>.
Riiiiicher commented on issue #2366:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2366#issuecomment-834117926


   找到解决方法了,用这个方式可以用服务名进行restTemplate形式的调用
   ```java
   RestTemplate restTemplate = RestTemplateBuilder.create();
   ResponseEntity<String> responseEntity = restTemplate.getForEntity(“cse://helloApp2:helloProvider/hello/sayHello?name={name}”, String.class, “ServiceComb”);
   ```


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