|
|
@ -21,6 +21,7 @@ import java.util.List; |
|
|
|
import java.util.function.Consumer; |
|
|
|
import java.util.function.Consumer; |
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Qualifier; |
|
|
|
import org.springframework.beans.factory.annotation.Qualifier; |
|
|
|
|
|
|
|
import org.springframework.boot.actuate.autoconfigure.web.ManagementContextConfiguration; |
|
|
|
import org.springframework.boot.actuate.health.Health; |
|
|
|
import org.springframework.boot.actuate.health.Health; |
|
|
|
import org.springframework.boot.autoconfigure.AutoConfigureAfter; |
|
|
|
import org.springframework.boot.autoconfigure.AutoConfigureAfter; |
|
|
|
import org.springframework.boot.autoconfigure.AutoConfigureBefore; |
|
|
|
import org.springframework.boot.autoconfigure.AutoConfigureBefore; |
|
|
@ -30,7 +31,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean |
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
|
|
|
import org.springframework.boot.autoconfigure.web.reactive.HttpHandlerAutoConfiguration; |
|
|
|
import org.springframework.boot.autoconfigure.web.reactive.HttpHandlerAutoConfiguration; |
|
|
|
import org.springframework.boot.context.properties.EnableConfigurationProperties; |
|
|
|
import org.springframework.boot.context.properties.EnableConfigurationProperties; |
|
|
|
import org.springframework.cloud.gateway.actuate.GatewayEndpoint; |
|
|
|
import org.springframework.cloud.gateway.actuate.GatewayWebfluxEndpoint; |
|
|
|
import org.springframework.cloud.gateway.filter.ForwardRoutingFilter; |
|
|
|
import org.springframework.cloud.gateway.filter.ForwardRoutingFilter; |
|
|
|
import org.springframework.cloud.gateway.filter.GlobalFilter; |
|
|
|
import org.springframework.cloud.gateway.filter.GlobalFilter; |
|
|
|
import org.springframework.cloud.gateway.filter.NettyRoutingFilter; |
|
|
|
import org.springframework.cloud.gateway.filter.NettyRoutingFilter; |
|
|
@ -370,15 +371,16 @@ public class GatewayAutoConfiguration { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Configuration |
|
|
|
@ManagementContextConfiguration |
|
|
|
|
|
|
|
@ConditionalOnProperty(value = "management.gateway.enabled", matchIfMissing = true) |
|
|
|
@ConditionalOnClass(Health.class) |
|
|
|
@ConditionalOnClass(Health.class) |
|
|
|
protected static class GatewayActuatorConfiguration { |
|
|
|
protected static class GatewayActuatorConfiguration { |
|
|
|
|
|
|
|
|
|
|
|
@Bean |
|
|
|
@Bean |
|
|
|
public GatewayEndpoint gatewayEndpoint(RouteDefinitionLocator routeDefinitionLocator, List<GlobalFilter> globalFilters, |
|
|
|
public GatewayWebfluxEndpoint gatewayWebfluxEndpoint(RouteDefinitionLocator routeDefinitionLocator, List<GlobalFilter> globalFilters, |
|
|
|
List<WebFilterFactory> webFilterFactories, RouteDefinitionWriter routeDefinitionWriter, |
|
|
|
List<WebFilterFactory> webFilterFactories, RouteDefinitionWriter routeDefinitionWriter, |
|
|
|
RouteLocator routeLocator) { |
|
|
|
RouteLocator routeLocator) { |
|
|
|
return new GatewayEndpoint(routeDefinitionLocator, globalFilters, webFilterFactories, routeDefinitionWriter, routeLocator); |
|
|
|
return new GatewayWebfluxEndpoint(routeDefinitionLocator, globalFilters, webFilterFactories, routeDefinitionWriter, routeLocator); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|