web123456

spring cloud calls feign request timeout: Read timed out executing POST

Problem introduction:

The call between services timed out, and the intercepted part of the error reported. Read timed out executing POST http://******

: Read timed out executing POST http://******
        at (:67)
        at (:104)
        at (:76)
        at $(:103)
        at .$(Unknown Source)
Caused by: : Read timed out
        at .socketRead0(Native Method)
        at (:116)
        at (:170)
        at (:141)
        at (:246)
        at .read1(:286)
        at (:345)
        at (:704)
        at (:647)
        at .getInputStream0(:1569)
        at (:1474)
        at (:480)
        at $(:152)
        at $(:74)

Causes and solutions:

It can be seen that the http request error timeout is reported. Feign calls are divided into two layers, ribbon calls and hystrix calls. The higher version of hystrix is ​​turned off by default, so you can set ribbon in the configuration file.

#Request processing timeout time
 : 120000
 #Timeout time for requesting connection
 : 30000

If hystrix is ​​enabled, the hystrix timeout error is reported as shown in the figure below:

FeignDemo#demo() timed-out and no fallback available. There is still a difference between the timeout error and the ribbon

: FeignDemo#demo() timed-out and no fallback available.
	at $(:819)
	at $(:804)
	at $(:140)
	at $(:87)
	at $(:87)
	at $DeprecatedOnFallbackHookApplication$(:1472)
	at $FallbackHookApplication$(:1397)
	at $(:87)
	at $(:230)
	Caused by: 
	at (:997)
	at $500(:60)
	at $(:610)
	at $(:601)

Solution:

: true
 hystrix circuit breaker mechanism
 hystrix:
   shareSecurityContext: true
   Command:
     default:
       circuitBreaker:
         sleepWindowInMilliseconds: 100000
         forceClosed: true
       execution:
         isolation:
           thread:
             timeoutInMilliseconds: 600000