SpringCloud服务消费者第一次调用出现超时问题的解决方案

https://www.cnblogs.com/yangzhilong/p/6770359.html

在第一次访问服务消费者的时候(消费者去调用服务提供者服务)会出现如下异常:

com.netflix.hystrix.exception.HystrixRuntimeException: TestService#hello(String) timed-out and no fallback available

解决方案是在application.properties增加如下配置信息:

#hystrix调用方法的超时时间,默认是1000毫秒
hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds=5000

 更绝的一个方案是直接禁用hystrix:

feign.hystrix.enabled=false

参考文章:http://www.tuicool.com/articles/vAr6Rb2

https://yq.aliyun.com/articles/61510

分类: SpringBoot,SpringCloud

猜你喜欢

转载自blog.csdn.net/xiyang_1990/article/details/84824016