spring-cloud-feign集成feign的几个注意事项
来源:互联网 发布:在家网络兼职的工作 编辑:程序博客网 时间:2024/05/17 02:14
1.首先版本选择较高的1.4.3.RELEASE版本
3.在设置feignclient时,如果调用第三方的接口,则需要设置name属性和url属性,如果调用本地在注册中心注册的服务,需要将value属性设置为service-id,如果需要断路由则需要配置fallback属性。
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.4.3.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent>
2.dependencyManagement版本选择Brixton.SR6版本
<dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-dependencies</artifactId> <version>Brixton.SR6</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement>
3.在设置feignclient时,如果调用第三方的接口,则需要设置name属性和url属性,如果调用本地在注册中心注册的服务,需要将value属性设置为service-id,如果需要断路由则需要配置fallback属性。
4.在application配置时如果需要通过turbine进行归纳监控数据,则需要添加@EnableCircuitBreaker注解,当然,如果设置@SpringCloudApplication注解的话,它本身包含了@EnableCircuitBreaker。
5.还有一点就是,如果你添加了swgger,如果版本比较低会导致在使用feign的时候报类空异常,导致无法启动程序,这是由于swgger和feign在低版本的时候有冲突,采用较新版本不会有这个问题。
0 0
- spring-cloud-feign集成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 Feign
- spring-cloud【Feign】
- spring cloud day03 【feign】
- spring cloud-Feign的Hystrix支持
- 四、Spring Cloud 的 Feign 组件
- Spring Cloud 的 Feign 组件 自定义配置
- Spring Cloud中Feign的继承特性
- spring cloud oauth2 feign 遇到的坑
- hive常用字符串函数
- 读取文件
- ThinkPHP中判断是手机端还是电脑端访问的方法
- Mysql插入图片
- [转载]Hive日期函数
- spring-cloud-feign集成feign的几个注意事项
- vc工程加入已有的类出现的问题
- Gradle for Android 第三篇( 依赖管理 )
- C#使用指定的字符替换除首尾字符外的字符
- Python 日期和时间学习
- iTest微服务测试经验总结(第一版)
- 棋盘型DP
- signal(SIGCHLD, SIG_IGN)和signal(SIGPIPE, SIG_IGN);
- 7.1 Tomcat学习(日志记录器Logger)