spring-cloud / spring-cloud-circuitbreaker

Spring Cloud Circuit Breaker API and Implementations
Apache License 2.0
332 stars 111 forks source link

Support resilience4j retry module [spring-cloud-circuitbreaker-resilience4j] #60

Closed olgakorichkovskaya closed 4 years ago

olgakorichkovskaya commented 4 years ago

Describe the bug Please add a possibility to configure and support of resilience4j retry https://resilience4j.readme.io/docs/retry

There is a problem in the case of using together Spring Cloud Gateway 'retry' and resilience4j 'fallback'.

Sample Using spring-cloud-circuitbreaker-resilience4j with Spring Cloud Gateway. If resilience4j fallback is configured it breaks Gateway 'retry'. Without fallback, retry works well. Simple application:

@SpringBootApplication
@EnableDiscoveryClient
public class DemoApplication {

    public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class, args);
    }

    @Bean
    public RouteLocator testRouteLocator(final RouteLocatorBuilder routeLocatorBuilder) {
        return routeLocatorBuilder.routes()
                .route("test Route", p -> p.path("/test-route")
                        .filters(f -> f.rewritePath("/test-route", "/v1/test-route")
                                .retry(3)
                                .circuitBreaker(c -> c.setName("testCircuitBreaker")
                                        .setFallbackUri("forward:/fallback/test")
                                )
                        )
                        .uri("lb://test-service")).build();
    }
}
// .. endpoint @RequestMapping("/fallback/test")

In this example, retry(3) does not work.

'springCloudVersion', "Hoxton.SR1" 'org.springframework.cloud:spring-cloud-starter-gateway' 'org.springframework.cloud:spring-cloud-starter-circuitbreaker-reactor-resilience4j'

ryanjbaxter commented 4 years ago

Can you provide the project as a zip or in github?

spring-projects-issues commented 4 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-projects-issues commented 4 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.