博客
关于我
系统整理springCloud系列(六)openfeign
阅读量:192 次
发布时间:2019-02-28

本文共 1325 字,大约阅读时间需要 4 分钟。

OpenFeign?????????

??????

??????OpenFeign????????????Feign????????????Maven????

org.springframework.cloud
spring-cloud-starter-openfeign

????????

?????????@SpringBootApplication?@EnableFeignClients??????OpenFeign??????????????

@SpringBootApplication@EnableEurekaClient@EnableFeignClientspublic class OrderFeignMain80 {    public static void main(String[] args) {        SpringApplication.run(OrderFeignMain80.class, args);    }}

??????

??Feign???????????????????????

@Component@FeignClient(value = "CLOUD-PAYMENT-SERVICE")public interface PaymentFeignService {    @GetMapping(value = "/payment/get/{id}")    public CommonResult getPaymentById(@PathVariable("id") Long id);}

??????

OpenFeign????Ribbon???????????????????????

  • ReadTimeout: 6000ms????????????
  • ConnectTimeout: 6000ms??????????

?????????

?????????????????????????????????????????

try {    Thread.sleep(10000L);} catch (InterruptedException e) {    e.printStackTrace();}

??????

?????????Feign????????????????????

@Configurationpublic class FeignConfig {    @Bean    public Logger.Level feignLoggerLevel() {        return Logger.Level.FULL;    }}

?????????

???????????????????????????

  • ???????????????????????????
  • Ribbon???????Ribbon?????????????
  • OpenFeign???????????????????????
  • ????????????????Feign??????????????????????????

    转载地址:http://jlon.baihongyu.com/

    你可能感兴趣的文章
    mysql常用命令
    查看>>
    MySQL常用指令集
    查看>>
    mysql常用操作
    查看>>
    MySQL常用日期格式转换函数、字符串函数、聚合函数详
    查看>>
    MySQL常见函数
    查看>>
    MySQL常见架构的应用
    查看>>
    MySQL常见的三种存储引擎(InnoDB、MyISAM、MEMORY)
    查看>>
    MySQL常见的三种存储引擎(InnoDB、MyISAM、MEMORY)
    查看>>
    MySQL常见约束条件
    查看>>
    MySQL常见错误
    查看>>
    MySQL常见错误分析与解决方法总结
    查看>>
    mysql并发死锁案例
    查看>>
    MySQL幻读:大家好,我是幻读,我今天又被解决了
    查看>>
    MySQL底层概述—1.InnoDB内存结构
    查看>>
    MySQL底层概述—2.InnoDB磁盘结构
    查看>>
    MySQL底层概述—3.InnoDB线程模型
    查看>>
    MySQL底层概述—4.InnoDB数据文件
    查看>>
    MySQL底层概述—5.InnoDB参数优化
    查看>>
    MySQL底层概述—6.索引原理
    查看>>
    MySQL底层概述—7.优化原则及慢查询
    查看>>