博客
关于我
系统整理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的decimal与Java的BigDecimal用法
    查看>>
    MySql的Delete、Truncate、Drop分析
    查看>>
    MySQL的Geometry数据处理之WKB方案
    查看>>
    MySQL的Geometry数据处理之WKT方案
    查看>>
    mysql的grant用法
    查看>>
    Mysql的InnoDB引擎的表锁与行锁
    查看>>
    mysql的InnoDB引擎索引为什么使用B+Tree
    查看>>
    MySQL的InnoDB默认隔离级别为 Repeatable read(可重复读)为啥能解决幻读问题?
    查看>>
    MySQL的insert-on-duplicate语句详解
    查看>>
    mysql的logrotate脚本
    查看>>
    MySQL的my.cnf文件(解决5.7.18下没有my-default.cnf)
    查看>>
    MySQL的on duplicate key update 的使用
    查看>>
    MySQL的Replace用法详解
    查看>>
    mysql的root用户无法建库的问题
    查看>>
    mysql的sql_mode参数
    查看>>
    MySQL的sql_mode模式说明及设置
    查看>>
    mysql的sql执行计划详解
    查看>>
    mysql的sql语句基本练习
    查看>>
    Mysql的timestamp(时间戳)详解以及2038问题的解决方案
    查看>>
    mysql的util类怎么写_自己写的mysql类
    查看>>