spring-cloud / spring-cloud-circuitbreaker

Spring Cloud Circuit Breaker API and Implementations
Apache License 2.0
329 stars 110 forks source link

Shouldn't resilience4j's time limiter respect Feign timeouts? #90

Closed eduardo-bueno-ifood closed 3 years ago

eduardo-bueno-ifood commented 3 years ago

Working with OpenFeign, Resilience4j completely disregards any connectTimeout/readTimeout configured in a client. I have tested with specific clients as well as feign.client.config.default. It would be nice to have things working in tandem.

Additionally, Resilience4j's documentation is really confusing and I can't find an equivalent of this Hystrix configuration:

hystrix:
  command:
    default:
      execution:
        isolation:
          thread:
            timeoutInMilliseconds: 5000

I tried it like below but it didn't work. Would appreciate if anyone knows how to tweak the default timeout.

resilience4j.timelimiter:
  instances:
    backendA:
      timeoutDuration: 5s
    backendB:
      timeoutDuration: 5s
ryanjbaxter commented 3 years ago

There is also a problem with OpenFeign and Hystrix https://docs.spring.io/spring-cloud-openfeign/docs/2.2.7.RELEASE/reference/html/#timeout-handling

Whatever timeout elapses first is going to "win".

Currently properties configuration is not supported #61, there is a PR to support it.

To configure timeouts read this documentation https://docs.spring.io/spring-cloud-circuitbreaker/docs/current/reference/html/#default-configuration

spring-cloud-issues commented 3 years ago

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

eduardo-bueno-ifood commented 3 years ago

Thank you. That fills the gap, yeah. It would be really nice to have to set a client timeout only once but one can imagine how difficult this should be. It also might not make sense in other cases.