openfeign调用超时feign.RetryableException: Read timed out executing POST http://xxxx

2022-08-03 10:09:22

遇到报错信息如下

o.a.c.c.C.[.[.[/].[dispatcherServlet]: Servlet.service()for servlet[dispatcherServlet] in context with path[] threw exception[Request processing failed; nested exception is feign.RetryableException: Read timed out executing POST http://xxxx] with root cause
java.net.SocketTimeoutException: Read timed out

解决方式:

  1. 先排除是否因为首次调用超时这类的问题:yaml配置:
ribbon:ReadTimeout: 时间数ConnectTimeout: 时间数eager-load:enabled:true#打开饥饿模式clients: 服务名1,服务名2#
  1. 在Controller调用Service时使用@Resource注解
  • 作者:chy_want
  • 原文链接:https://blog.csdn.net/chy_want/article/details/112442154
    更新时间:2022-08-03 10:09:22