2 years ago
#60453
docklet
Spring Cloud GW -Resilience4j overrides http message
I am trying to add resillience4j to my spring cloud gw project.And I am using settings below to record some specific http codes as exception which is works well. But there is some minor tricky situation.
This is my filter added to my route. When 409 status code comes as response from the route my circuit recording and counting it.
filters:
- name: CircuitBreaker
args:
name: myCircuitBreaker
statusCodes:
- 409
But at the client side of the gateway project I am getting 500 Internal Server Error. And when i checked the logs of gateway project i can see that actual error code.
recorded an error: 'org.springframework.cloud.gateway.filter.factory.SpringCloudCircuitBreakerFilterFactory$CircuitBreakerStatusCodeException: 409 CONFLICT'. Elapsed time: 131 ms 2022-01-17T11:55:53.191782442Z 2022-01-17 14:55:53.190 ERROR 7 --- [or-http-epoll-2] a.w.r.e.AbstractErrorWebExceptionHandler : [54b3d2d3-2] 500 Server Error for HTTP PUT "/bookservice/api/v1/users/741180f5-a32d-40c3-830e-05fc701c1b07" 2022-01-17T11:55:53.191812771Z 2022-01-17T11:55:53.191815233Z org.springframework.cloud.gateway.filter.factory.SpringCloudCircuitBreakerFilterFactory$CircuitBreakerStatusCodeException: 409 CONFLICT 2022-01-17T11:55:53.191817141Z at org.springframework.cloud.gateway.filter.factory.SpringCloudCircuitBreakerFilterFactory$1.lambda$filter$0(SpringCloudCircuitBreakerFilterFactory.java:101) ~[spring-cloud-gateway-server-3.0.4.jar!/:3.0.4] 2022-01-17T11:55:53.191819403Z Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException: 2022-01-17T11:55:53.191821132Z Error has been observed at the following site(s): 2022-01-17T11:55:53.191822829Z |_ checkpoint ⇢ org.springframework.cloud.gateway.filter.WeightCalculatorWebFilter [DefaultWebFilterChain] 2022-01-17T11:55:53.191825077Z |_ checkpoint ⇢ org.springframework.boot.actuate.metrics.web.reactive.server.MetricsWebFilter [DefaultWebFilterChain] 2022-01-17T11:55:53.191826936Z |_ checkpoint ⇢ HTTP PUT "/bookservice/api/v1/users/741180f5-a32d-40c3-830e-05fc701c1b07" [ExceptionHandlingWebHandler]
How to change this behaviour ? Thanks in advance.
java
spring-cloud-gateway
resilience4j
0 Answers
Your Answer