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

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

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

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

 

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

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

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

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

④server B中可以直接@Autowired接口C,并使用其中的方法。

之后在对@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/

 

 

转载于:https://my.oschina.net/u/3786691/blog/2032338

你可能感兴趣的:(python)