zoukankan      html  css  js  c++  java
  • springcoud feign超时的问题

    配置

    #开启超时控制 打开feign-hystix
    feign.hystrix.enabled=true
    ribbon.ReadTimeout=60000
    ribbon.ConnectTimeout=60000
    #如果enabled设置为false,则请求超时交给ribbon控制
    hystrix.command.default.execution.timeout.enabled=true
    #设置超时时间  单位是毫秒
    hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds=60000  

    熔断器一定要引入

    <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-actuator</artifactId>
            </dependency>

    代码

    @Component
    public class SendInfoAuditFallBack implements SendInfoAudit {
        private Logger logger = LoggerFactory.getLogger(SendInfoAuditFallBack.class);
    
        @Override
        public String proclmInfo(String plyNo) {
            logger.error("请求定责系统异常:" + plyNo);
            return "error 401";
        }
    }
    @FeignClient(name="claimaudit",fallback = SendInfoAuditFallBack.class)
    public interface SendInfoAudit {
        @RequestMapping(value = "/fixDutyServiceController/proclmInfo")
        public String proclmInfo(@RequestParam("plyNo") String plyNo);
    }
  • 相关阅读:
    Codeforces #533 div2 做题记录
    算法竞赛模板 打印素数表
    算法竞赛模板 计算组合数
    Educational Codeforces Round 34 (Rated for Div. 2)
    ACM感悟 -----sdust
    Codeforces Round #450 (Div. 2)
    EOJ Monthly 2017.12
    Wannafly挑战赛5
    二分图匹配
    今日颓废
  • 原文地址:https://www.cnblogs.com/mutong1228/p/10192760.html
Copyright © 2011-2022 走看看