From aae5161a867d0682ef48b0aa535110f8698a9915 Mon Sep 17 00:00:00 2001 From: Spencer Gibb Date: Wed, 23 Aug 2017 14:07:59 -0600 Subject: [PATCH] Add a property to disable the gateway. --- .../cloud/gateway/config/GatewayAutoConfiguration.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/config/GatewayAutoConfiguration.java b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/config/GatewayAutoConfiguration.java index 54281a6ec..185ed12cb 100644 --- a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/config/GatewayAutoConfiguration.java +++ b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/config/GatewayAutoConfiguration.java @@ -27,6 +27,7 @@ import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.web.reactive.HttpHandlerAutoConfiguration; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.cloud.gateway.actuate.GatewayEndpoint; @@ -103,6 +104,7 @@ import rx.RxReactiveStreams; * @author Spencer Gibb */ @Configuration +@ConditionalOnProperty(name = "spring.cloud.gateway.enabled", matchIfMissing = true) @EnableConfigurationProperties @AutoConfigureBefore(HttpHandlerAutoConfiguration.class) @AutoConfigureAfter(GatewayLoadBalancerClientAutoConfiguration.class)