Migrate server-webmvc properties to new namespace
See gh-3647
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
To include Spring Cloud Gateway Server Web MVC in your project, use the starter with a group ID of `org.springframework.cloud` and an artifact ID of `spring-cloud-starter-gateway-server-webmvc`.
|
||||
See the https://projects.spring.io/spring-cloud/[Spring Cloud Project page] for details on setting up your build system with the current Spring Cloud Release Train.
|
||||
|
||||
If you include the starter, but you do not want the gateway to be enabled, set `spring.cloud.gateway.mvc.enabled=false`.
|
||||
If you include the starter, but you do not want the gateway to be enabled, set `spring.cloud.gateway.server.webmvc.enabled=false`.
|
||||
|
||||
IMPORTANT: Spring Cloud Gateway Server MVC is built on https://spring.io/projects/spring-boot#learn[Spring Boot] and https://docs.spring.io/spring-framework/reference/web/webmvc-functional.html[Spring WebMvc.fn].
|
||||
As a consequence, many of the asynchronous or reactive libraries may not apply when you use Spring Cloud Gateway Server MVC.
|
||||
|
||||
@@ -22,11 +22,12 @@ import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.cloud.gateway.server.mvc.config.GatewayMvcProperties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@AutoConfigureBefore(GatewayServerMvcAutoConfiguration.class)
|
||||
@ConditionalOnProperty(name = "spring.cloud.gateway.mvc.enabled", matchIfMissing = true)
|
||||
@ConditionalOnProperty(name = GatewayMvcProperties.PREFIX + ".enabled", matchIfMissing = true)
|
||||
public class GatewayMvcClassPathWarningAutoConfiguration {
|
||||
|
||||
private static final Log log = LogFactory.getLog(GatewayMvcClassPathWarningAutoConfiguration.class);
|
||||
|
||||
@@ -78,7 +78,7 @@ import org.springframework.web.client.RestClient;
|
||||
@AutoConfiguration(after = { HttpClientAutoConfiguration.class, RestTemplateAutoConfiguration.class,
|
||||
RestClientAutoConfiguration.class, FilterAutoConfiguration.class, HandlerFunctionAutoConfiguration.class,
|
||||
PredicateAutoConfiguration.class })
|
||||
@ConditionalOnProperty(name = "spring.cloud.gateway.mvc.enabled", matchIfMissing = true)
|
||||
@ConditionalOnProperty(name = GatewayMvcProperties.PREFIX + ".enabled", matchIfMissing = true)
|
||||
@Import(GatewayMvcPropertiesBeanDefinitionRegistrar.class)
|
||||
@ImportRuntimeHints(GatewayMvcAotRuntimeHintsRegistrar.class)
|
||||
public class GatewayServerMvcAutoConfiguration {
|
||||
|
||||
@@ -43,7 +43,7 @@ import static org.springframework.cloud.gateway.server.mvc.handler.HandlerFuncti
|
||||
import static org.springframework.cloud.gateway.server.mvc.predicate.GatewayRequestPredicates.host;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@SpringBootTest(properties = { "spring.cloud.gateway.mvc.http-client.type=jdk" },
|
||||
@SpringBootTest(properties = { "spring.http.client.factory=jdk" },
|
||||
webEnvironment = WebEnvironment.RANDOM_PORT)
|
||||
@ContextConfiguration(initializers = HttpbinTestcontainers.class)
|
||||
public class VanillaRouterFunctionTests {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
spring.cloud.gateway.mvc:
|
||||
spring.cloud.gateway.server.webmvc:
|
||||
routesMap:
|
||||
testsimplefunction:
|
||||
uri: fn:upper
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
spring.cloud.gateway.mvc:
|
||||
spring.cloud.gateway.server.webmvc:
|
||||
routesMap:
|
||||
route1:
|
||||
uri: https://example1.com
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
spring.cloud.gateway.mvc:
|
||||
spring.cloud.gateway.server.webmvc:
|
||||
routesMap:
|
||||
testsimplestream:
|
||||
uri: stream:hello-out-0
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
strip.prefix.static.uri: http://${httpbin.host}:${httpbin.port}
|
||||
spring.cloud.gateway.mvc:
|
||||
spring.cloud.gateway.server.webmvc:
|
||||
routes:
|
||||
- id: strip_prefix_static_port_config
|
||||
uri: ${strip.prefix.static.uri}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
spring.cloud.gateway.mvc:
|
||||
spring.cloud.gateway.server.webmvc:
|
||||
routes:
|
||||
- id: weight_high_test
|
||||
uri: https://examplel1.com
|
||||
|
||||
@@ -1966,16 +1966,6 @@
|
||||
"since": "4.3.0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "spring.cloud.gateway.mvc.routes",
|
||||
"type": "java.util.List<org.springframework.cloud.gateway.route.RouteDefinition>",
|
||||
"description": "List of Routes.",
|
||||
"deprecated": true,
|
||||
"deprecation": {
|
||||
"replacement": "spring.cloud.gateway.server.webflux.mvc.routes",
|
||||
"since": "4.3.0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "spring.cloud.gateway.observability.enabled",
|
||||
"type": "java.lang.Boolean",
|
||||
|
||||
Reference in New Issue
Block a user