spring-cloud / spring-cloud-circuitbreaker

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

I want to configure a generic Bulkhead and Retry in Spring Cloud Gateway #85

Closed gentlelegant closed 3 years ago

gentlelegant commented 3 years ago

I'm always frustrated when I configured the circuit breaker through the Resilience4JCircuitBreakerFactory, I didn't seem to be able to do the same for the rest of the Resilience4J

ryanjbaxter commented 3 years ago

Can you provide examples of what else you want to do?

gentlelegant commented 3 years ago

Well, I wanted to integrate all of Resience4J features into the Spring Cloud Gateway. Of course, it was just a whim on mine

ryanjbaxter commented 3 years ago

Really this library is specifically around circuit breakers, Resilience4J provides many other features, so I am not sure they make sense in this library.

That said, is there something preventing you from using the rest of the Resilience4J features?

Ferioney commented 3 years ago

I have a similar question regarding supporting Bulkhead module

I'm planning to migrate from Hystrix to spring-cloud-starter-circuitbreaker-resilience4j. In Hystrix we have possibility to configure and control a thread pool for each request Hystrix Threads & Thread Pools. Resilience4J provides module Bulkhead to do similar things, and it can be useful to resolve this problem.

But as I can see in class Resilience4JCircuitBreaker all requests will be executed in one shared executor service

In this case usage of Buldhead module can't help me. Yes, circuit breaker and time limit will be executed in a separate thread but in the end all requests will be executed in one executor service

gentlelegant commented 3 years ago

For example, I want to use the Resience4J retry function to replace the retry function of Spring Cloud Gateway itself.

But I can't seem to find an easy way to implement this idea. This may seem like a thankless task, and Spring Cloud Gateway has its own retry implementation.

ryanjbaxter commented 3 years ago

@Ferioney using the Bulkhead module as opposed to the generic ExecutorService makes sense. I have opened a separate issue to support that https://github.com/spring-cloud/spring-cloud-circuitbreaker/issues/86

ryanjbaxter commented 3 years ago

@gentlelegant

I want to use the Resience4J retry function to replace the retry function of Spring Cloud Gateway itself.

This is an issue that should be opened in the Spring Cloud Gateway project as it doesn't have anything to do with the circuit breaker directly.

I want to use the Resience4J retry function to replace the retry function of Spring Cloud Gateway itself. https://docs.spring.io/spring-cloud-gateway/docs/current/reference/html/#the-retry-gatewayfilter-factory

Ferioney commented 3 years ago

@ryanjbaxter Thank you!

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.

spring-cloud-issues commented 3 years ago

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.