|
|
|
@ -120,14 +120,12 @@ public class SpringCloudCircuitBreakerTestConfig {
@@ -120,14 +120,12 @@ public class SpringCloudCircuitBreakerTestConfig {
|
|
|
|
|
.circuitBreaker(config -> config.setName("stalling-command"))) |
|
|
|
|
.uri(uri)) |
|
|
|
|
.route("circuitbreaker_fallback_test_reset_exchange", |
|
|
|
|
r -> r.host("**.circuitbreakerresetexchange.org") |
|
|
|
|
.filters(f -> f.circuitBreaker(config -> config.setName("fallbackcmd") |
|
|
|
|
r -> r.host("**.circuitbreakerresetexchange.org").filters(f -> f |
|
|
|
|
.circuitBreaker(config -> config.setName("fallbackcmd") |
|
|
|
|
.setFallbackUri("forward:/resetExchangeFallbackController")) |
|
|
|
|
.filter((exchange, chain) -> chain.filter(exchange) |
|
|
|
|
.then(Mono.defer(() -> |
|
|
|
|
!exchange.getResponse().isCommitted() ? |
|
|
|
|
Mono.error(new Exception("Some Random Exception")) : |
|
|
|
|
Mono.empty())))) |
|
|
|
|
.filter((exchange, chain) -> chain.filter(exchange) |
|
|
|
|
.then(Mono.defer(() -> !exchange.getResponse().isCommitted() |
|
|
|
|
? Mono.error(new Exception("Some Random Exception")) : Mono.empty())))) |
|
|
|
|
.uri(uri)) |
|
|
|
|
.build(); |
|
|
|
|
} |
|
|
|
|