遇到报错信息如下
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
解决方式:
- 先排除是否因为首次调用超时这类的问题:yaml配置:
ribbon:ReadTimeout: 时间数ConnectTimeout: 时间数eager-load:enabled:true#打开饥饿模式clients: 服务名1,服务名2#
- 在Controller调用Service时使用@Resource注解