spring-cloud / spring-cloud-gateway

An API Gateway built on Spring Framework and Spring Boot providing routing and more.
http://cloud.spring.io
Apache License 2.0
4.52k stars 3.32k forks source link

SpringCloud Gateway does not use Hystrix how to set timeouts #750

Closed bolinzhang closed 5 years ago

bolinzhang commented 5 years ago

Currently our production environment uses Hystrix , Due to the use of Hystrix to make settings such as timeouts , the request cannot be processed after running online for a period of time.

Throw a lot:

2019-01-05 16:51:08 [com.lottery.exception.ExceptionHandler:50] ERROR - cloud-member failed and fallback failed.
2019-01-05 16:51:09 [com.lottery.exception.ExceptionHandler:50] ERROR - cloud-member failed and fallback failed.
2019-01-05 16:51:09 [com.lottery.exception.ExceptionHandler:50] ERROR - cloud-member failed and fallback failed.
2019-01-05 16:51:10 [com.lottery.exception.ExceptionHandler:50] ERROR - cloud-member failed and fallback failed.
2019-01-05 16:51:10 [com.lottery.exception.ExceptionHandler:50] ERROR - cloud-member failed and fallback failed.
2019-01-05 16:51:11 [com.lottery.exception.ExceptionHandler:50] ERROR - cloud-member failed and fallback failed.
2019-01-05 16:51:11 [com.lottery.exception.ExceptionHandler:50] ERROR - cloud-member failed and fallback failed.
2019-01-05 16:51:12 [com.lottery.exception.ExceptionHandler:50] ERROR - cloud-member failed and fallback failed.
2019-01-05 16:51:12 [com.lottery.exception.ExceptionHandler:50] ERROR - cloud-member failed and fallback failed.
2019-01-05 16:51:13 [com.lottery.exception.ExceptionHandler:50] ERROR - cloud-member failed and fallback failed.

It will be normal after restarting SpringCloud Gateway, but still for a while .

Can I set the timeout in other ways instead of using Hystrix?

ryanjbaxter commented 5 years ago

I dont see how this is a problem with the Gateway.

crazyman2010 commented 5 years ago

just use this: spring.cloud.gateway.httpclient.connect-timeout=10000 spring.cloud.gateway.httpclient.response-timeout=15s

bolinzhang commented 5 years ago

10000

image

spring.cloud.gateway.httpclient.response-timeout=15s

I don't have this configuration here.

Gsealy commented 5 years ago

@bolinzhang check you IDEA, our IDE is fine. image

spencergibb commented 5 years ago

Hystrix properties are not auto completed by IDEs, they still work.