Deprecate @EnableGateway
This commit is contained in:
@@ -23,20 +23,18 @@ import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import org.springframework.cloud.gateway.config.GatewayConfiguration;
|
||||
import org.springframework.context.annotation.Import;
|
||||
|
||||
/**
|
||||
* Annotation to activate Spring Cloud Gateway configuration {@link org.springframework.cloud.gateway.config.GatewayAutoConfiguration}
|
||||
*
|
||||
* @deprecated taken care of by auto-configuration now. To be removed in future milestone.
|
||||
* @author Spencer Gibb
|
||||
*
|
||||
*/
|
||||
|
||||
@Deprecated
|
||||
@Target(ElementType.TYPE)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@Import(GatewayConfiguration.class)
|
||||
public @interface EnableGateway {
|
||||
|
||||
}
|
||||
|
||||
@@ -34,8 +34,6 @@ import org.springframework.cloud.gateway.filter.GlobalFilter;
|
||||
import org.springframework.cloud.gateway.filter.NettyRoutingFilter;
|
||||
import org.springframework.cloud.gateway.filter.NettyWriteResponseFilter;
|
||||
import org.springframework.cloud.gateway.filter.RouteToRequestUrlFilter;
|
||||
import org.springframework.cloud.gateway.filter.WebClientHttpRoutingFilter;
|
||||
import org.springframework.cloud.gateway.filter.WebClientWriteResponseFilter;
|
||||
import org.springframework.cloud.gateway.filter.WebsocketRoutingFilter;
|
||||
import org.springframework.cloud.gateway.filter.factory.AddRequestHeaderWebFilterFactory;
|
||||
import org.springframework.cloud.gateway.filter.factory.AddRequestParameterWebFilterFactory;
|
||||
@@ -88,14 +86,13 @@ import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
import org.springframework.data.redis.core.script.DefaultRedisScript;
|
||||
import org.springframework.data.redis.core.script.RedisScript;
|
||||
import org.springframework.scripting.support.ResourceScriptSource;
|
||||
|
||||
import com.netflix.hystrix.HystrixObservableCommand;
|
||||
|
||||
import org.springframework.web.reactive.function.client.WebClient;
|
||||
import org.springframework.web.reactive.socket.client.ReactorNettyWebSocketClient;
|
||||
import org.springframework.web.reactive.socket.client.WebSocketClient;
|
||||
import org.springframework.web.reactive.socket.server.WebSocketService;
|
||||
import org.springframework.web.reactive.socket.server.support.HandshakeWebSocketService;
|
||||
|
||||
import com.netflix.hystrix.HystrixObservableCommand;
|
||||
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.ipc.netty.http.client.HttpClient;
|
||||
import reactor.ipc.netty.http.client.HttpClientOptions;
|
||||
@@ -106,7 +103,6 @@ import rx.RxReactiveStreams;
|
||||
* @author Spencer Gibb
|
||||
*/
|
||||
@Configuration
|
||||
@ConditionalOnBean(GatewayConfiguration.Marker.class)
|
||||
@EnableConfigurationProperties
|
||||
@AutoConfigureBefore(HttpHandlerAutoConfiguration.class)
|
||||
@AutoConfigureAfter(GatewayLoadBalancerClientAutoConfiguration.class)
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
/*
|
||||
* Copyright 2013-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
package org.springframework.cloud.gateway.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* @author Spencer Gibb
|
||||
*/
|
||||
@Configuration
|
||||
public class GatewayConfiguration {
|
||||
|
||||
@Bean
|
||||
public Marker gatewayMarker() {
|
||||
return new Marker();
|
||||
}
|
||||
|
||||
class Marker { }
|
||||
}
|
||||
@@ -31,7 +31,6 @@ import org.springframework.context.annotation.Configuration;
|
||||
*/
|
||||
@Configuration
|
||||
@ConditionalOnClass({LoadBalancerClient.class, RibbonAutoConfiguration.class})
|
||||
@ConditionalOnBean(GatewayConfiguration.Marker.class)
|
||||
@AutoConfigureAfter(RibbonAutoConfiguration.class)
|
||||
public class GatewayLoadBalancerClientAutoConfiguration {
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@ import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.junit.Before;
|
||||
import org.springframework.boot.web.server.LocalServerPort;
|
||||
import org.springframework.cloud.gateway.EnableGateway;
|
||||
import org.springframework.cloud.gateway.filter.GlobalFilter;
|
||||
import org.springframework.cloud.gateway.route.Route;
|
||||
import org.springframework.cloud.netflix.ribbon.RibbonClient;
|
||||
@@ -84,7 +83,6 @@ public class BaseWebClientTests {
|
||||
@RibbonClient(name = "testservice", configuration = TestRibbonConfig.class),
|
||||
@RibbonClient(name = "myservice", configuration = TestRibbonConfig.class)
|
||||
})
|
||||
@EnableGateway
|
||||
protected static class DefaultTestConfig {
|
||||
|
||||
private static final Log log = LogFactory.getLog(DefaultTestConfig.class);
|
||||
|
||||
@@ -22,13 +22,11 @@ import org.springframework.boot.SpringBootConfiguration;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.cloud.client.discovery.DiscoveryClient;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
import org.springframework.cloud.gateway.EnableGateway;
|
||||
import org.springframework.cloud.gateway.discovery.DiscoveryClientRouteDefinitionLocator;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Profile;
|
||||
|
||||
@EnableGateway
|
||||
@SpringBootConfiguration
|
||||
@EnableAutoConfiguration
|
||||
public class GatewayTestApplication {
|
||||
|
||||
@@ -20,7 +20,6 @@ package org.springframework.cloud.gateway.sample;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.SpringBootConfiguration;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.cloud.gateway.EnableGateway;
|
||||
import org.springframework.cloud.gateway.route.RouteLocator;
|
||||
import org.springframework.cloud.gateway.route.Routes;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
@@ -40,7 +39,6 @@ import static org.springframework.tuple.TupleBuilder.tuple;
|
||||
*/
|
||||
@SpringBootConfiguration
|
||||
@EnableAutoConfiguration
|
||||
@EnableGateway
|
||||
public class GatewaySampleApplication {
|
||||
|
||||
@Bean
|
||||
|
||||
Reference in New Issue
Block a user