补充微服务框架中微服务的远程调用

原文:https://my.oschina.net/u/3786691/blog/1923529spring

主要补充微服务间的远程调用,项目的远程调用使用了@FeignClient注解。微服务

 

说一下远程调用的过程,这其中共有三个角色:被调用者微服务server A,调用者微服务server Burl

①server A中定义两个服务接口。spa

②server B中写一个接口C,接口上使用@FeignClient(value=server A)注解,接口内部经过url绑定server A的两个接口。.net

③server B入口类须要实现@EnableFeignClients注解。server

④server B中能够直接@Autowired接口C,并使用其中的方法。blog

以后在对@FeignClient和@EnableFeignClients进一步了解。接口

 

参考:https://blog.csdn.net/kangkanglou/article/details/76407623方法

https://blog.csdn.net/zwx19921215/article/details/79804379项目

http://blog.didispace.com/spring-cloud-starter-dalston-2-3/