spring-cloud-gateway icon indicating copy to clipboard operation
spring-cloud-gateway copied to clipboard

Issue in circuit breaker with SpringBoot3

Open kartik-kaushik opened this issue 2 years ago • 3 comments

circuitbreaker is not working as expected in spring boot3

application.yml

spring: application: name: gateway-service cloud: gateway: routes: - id: customer-service uri: http://localhost:8092 predicates: - Path=/customer/** filters: - RewritePath=/customer/(?.), /${path} - name: CircuitBreaker args: routeId: service-fallback name: service-fallback fallbackUri: forward:/order/hello statusCodes: - 500 - 503 - 502 - id: order-service uri: http://localhost:8090 predicates: - Path=/order/hello filters: - RewritePath=/order/(?.), /${path}

logging.level.io.github.resilience4j: DEBUG logging.level.org.springframework.cloud.gateway.filter.factory: TRACE

Dependencies used:

<groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-gateway<artifactId> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-circuitbreaker-reactor-resilience4j</artifactId>

with spring boot 2.7.10 and cloud 2021.0.6, the request was going to order-service (http://localhost:8090) if http://localhost:8092 is down.

but after upgrading to spring boot 3.0.5 and cloud 2022.0.2, the request is going into a infinite loop and not going to order-service if http://localhost:8092 is down.

kartik-kaushik avatar Apr 04 '23 16:04 kartik-kaushik

I have the same issue

nicolas-zheng avatar Apr 27 '23 06:04 nicolas-zheng

https://github.com/spring-cloud/spring-cloud-gateway/pull/2918 should fix this problem :arrow_right: either use version 4.0.5 directly or wait for the next spring-cloud-release.

Felixel42 avatar May 19 '23 14:05 Felixel42

HI, @Felixel42

I´m working with Spring Boot 3.1.6 and don´t working Circuit Breaker, ¿Do you know the versión Spring Boot is the correct?

Thanks.

JO503688 avatar Feb 11 '24 00:02 JO503688

@JO503688 see https://start.spring.io Spring Boot 3.2.3 and Spring Cloud 2023.0.0 or boot 3.1.9 and cloud 2022.0.5 both have the fix

spencergibb avatar Mar 12 '24 05:03 spencergibb