博客
关于我
系统整理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/

    你可能感兴趣的文章
    Objective-C实现MAC桌面暗水印(附完整源码)
    查看>>
    Objective-C实现mandelbrot曼德勃罗特集算法(附完整源码)
    查看>>
    Objective-C实现markov chain马尔可夫链算法(附完整源码)
    查看>>
    Objective-C实现MATLAB中Filter函数功能(附完整源码)
    查看>>
    Objective-C实现matrix chainorder矩阵链顺序算法(附完整源码)
    查看>>
    Objective-C实现matrix exponentiation矩阵求幂算法(附完整源码)
    查看>>
    Objective-C实现MatrixMultiplication矩阵乘法算法 (附完整源码)
    查看>>
    Objective-C实现max non adjacent sum最大非相邻和算法(附完整源码)
    查看>>
    Objective-C实现max subarray sum最大子数组和算法(附完整源码)
    查看>>
    Objective-C实现max sum sliding window最大和滑动窗口算法(附完整源码)
    查看>>
    Objective-C实现MaxHeap最大堆算法(附完整源码)
    查看>>
    Objective-C实现MaximumSubarray最大子阵列(Brute Force蛮力解决方案)算法(附完整源码)
    查看>>
    Objective-C实现MaximumSubarray最大子阵列(动态规划解决方案)算法(附完整源码)
    查看>>
    Objective-C实现maxpooling计算(附完整源码)
    查看>>
    Objective-C实现max_difference_pair最大差异对算法(附完整源码)
    查看>>
    Objective-C实现max_heap最大堆算法(附完整源码)
    查看>>
    Objective-C实现MD5 (附完整源码)
    查看>>
    Objective-C实现md5算法(附完整源码)
    查看>>
    Objective-C实现MeanSquareError均方误差算法 (附完整源码)
    查看>>
    Objective-C实现median filter中值滤波器算法(附完整源码)
    查看>>