1. 如何包含 Spring Cloud Gateway
要在项目中包含 Spring Cloud Gateway,请使用组 ID 为org.springframework.cloud
项目 ID 为spring-cloud-starter-gateway
.
有关使用当前 Spring Cloud Release Train 设置构建系统的详细信息,请参阅 Spring Cloud 项目页面。
如果包含Starters,但不希望启用网关,请将spring.cloud.gateway.enabled=false
.
Spring Cloud Gateway 基于 Spring Boot 2.x、Spring WebFlux 和 Project Reactor 构建。 因此,当您使用 Spring Cloud Gateway 时,您所知道的许多熟悉的同步库(例如 Spring Data 和 Spring Security)和模式可能不适用。 如果您不熟悉这些项目,我们建议您在使用 Spring Cloud Gateway 之前先阅读他们的文档以熟悉一些新概念。 |
Spring Cloud Gateway 需要 Spring Boot 和 Spring Webflux 提供的 Netty 运行时。 它在传统的 Servlet 容器中或作为 WAR 构建时不起作用。 |