spring-boot Feign
来源:互联网 发布:vb str是什么意思 编辑:程序博客网 时间:2024/06/04 00:22
@SpringBootApplication@EnableEurekaClient@RestController@EnableFeignClients //开启feignpublic class DemoApplication {@AutowiredHelloClient client;@GetMapping("/hello/{name}")public String hello(@PathVariable String name){System.out.println(name+" welcome . My is microservice provider user");return name+" welcome . I'm microservice provider user";}@RequestMapping("/say")public String hello() {return client.hello();}@FeignClient("provider-user")interface HelloClient {@GetMapping("/add")String hello();}public static void main(String[] args) {SpringApplication.run(DemoApplication.class, args);}}
@RequestMapping("/add")public String hello2() { return "Hello";}Feign接口的请求映射需与注册到eureka的服务的请求地址(/add)一致,方法名可不一致,
当请求/say,则会请求到hello2方法
阅读全文
0 0
- spring-boot Feign
- spring boot 使用feign
- spring-cloud-feign之spring-cloud-1.3.4(Dalston.SR3)-boot(1.5.6) 学习笔记
- Spring Cloud feign
- Spring Cloud Feign诠释
- spring cloud-feign
- Spring Cloud Feign常见问题
- spring cloud Feign
- spring cloud feign
- Spring Cloud feign使用
- Spring Cloud Feign
- Spring Cloud Feign
- spring-cloud【Feign】
- spring cloud day03 【feign】
- spring-cloud-starter-feign 组件在spring boot中的应用:访问Oauth2资源服务器的资源接口
- Spring Cloud之Feign入门
- Spring Cloud Feign实例讲解
- Spring Cloud Feign 使用方式
- CSS3-用过渡实现气泡效果
- JavaWeb学习总结(五十)——文件上传和下载
- VS2012+QT+openGL编译错误
- MySQL索引专题一 认识索引
- 【Mongo】 批量删除集合
- spring-boot Feign
- 实例讲解Android中AsyncTask的使用详解
- Unix环境编程之 进程控制
- Qt5 中对 C++11 一些新特性的封装详解(一)
- tomcat部署简单的html静态网页
- code length overflow jquery qrcode
- Java实现二叉树
- 获取微信公众号的二维码图片
- bzoj 4145: [AMPPZ2014]The Prices 状压dp