Spring Cloud中,如何解决Feign/Ribbon第一次请求失败的问题?

在Spring Cloud中,Feign和Ribbon整合Hystrix后可能出现首次请求失败的情况,主要原因是Hystrix默认1秒超时。解决办法包括:延长Hystrix超时时间、禁用Hystrix超时、全局禁用Feign的Hystrix、配置Ribbon饥饿加载和模拟请求预热。其中,Ribbon的饥饿加载是最佳实践,但在某些特定场景可能存在风险。
摘要由CSDN通过智能技术生成

Spring Cloud中,Feign和Ribbon在整合了Hystrix后,可能会出现首次调用失败的问题,要如何解决该问题呢?

2019-01-28  16:19:46.074    INFO  3740  ---  [nio-9790-exec-2]  s.c.a.AnnotationConfigApplicationContext  :  Refreshing  SpringClientFactory-ms-dyh-manufacturer:  startup  date  [Mon  Jan  28  16:19:46  CST  2019];  parent:  org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@15b986cd
2019-01-28  16:19:46.411    INFO  3740  ---  [nio-9790-exec-2]  f.a.AutowiredAnnotationBeanPostProcessor  :  JSR-330  'javax.inject.Inject'  annotation  found  and  supported  for  autowiring
2019-01-28  16:19:46.671    INFO  3740  ---  [nio-9790-exec-2]  c.netflix.config.ChainedDynamicProperty    :  Flipping  property:  ms-dyh-manufacturer.ribbon.ActiveConnectionsLimit  to  use  NEXT  property:  niws.loadbalancer.availabilityFilteringRule.activeConnectionsLimit  =  2147483647
2019-01-28  16:19:46.715    INFO  3740  ---  [nio-9790-exec-2]  c.n.u.concurrent.ShutdownEnabledTimer        :  Shutdown  hook  installed  for:  NFLoadBalancer-PingTimer-ms-dyh-manufacturer
2019-01-28  16:19:46.776    INFO  3740  ---  [nio-9790-exec-2]  c.netflix.loadbalancer.BaseLoadBalancer    :  Client:  ms-dyh-manufacturer  instantiated  a  LoadBalancer:  DynamicServerListLoadBalancer:{NFLoadBalancer:name=ms-dyh-manufacturer,current  list  of  Servers=[],Load  balancer  stats=Zone  stats:  {},Server  stats:  []}ServerList:null
2019-01-28  16:19:46.783    INFO  3740  ---  [nio-9790-exec-2]  c.n.l.DynamicServerListL
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值