diff --git a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/filter/factory/HystrixGatewayFilterFactory.java b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/filter/factory/HystrixGatewayFilterFactory.java index e2a1544b..9b460296 100644 --- a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/filter/factory/HystrixGatewayFilterFactory.java +++ b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/filter/factory/HystrixGatewayFilterFactory.java @@ -105,7 +105,7 @@ public class HystrixGatewayFilterFactory extends AbstractGatewayFilterFactory f.prefixPath("/httpbin") .hystrix(config -> config.setFallbackUri("forward:/fallbackcontroller2"))) .uri(uri)) + .route("hystrix_connection_failure", r -> r.host("**.hystrixconnectfail.org") + .filters(f -> f.prefixPath("/httpbin") + .hystrix(config -> {})) + .uri("lb:badservice")) .build(); } } + + protected static class TestBadRibbonConfig { + + @LocalServerPort + protected int port = 0; + + @Bean + public ServerList ribbonServerList() { + return new StaticServerList<>(new Server("https", "localhost", this.port)); + } + } }