如何引入 Spring Cloud Gateway

要在项目中包含 Spring Cloud Gateway,请使用 starter,其 groupId 为 org.springframework.cloud,artifactId 为 spring-cloud-starter-gateway-server-webflux。有关使用当前 Spring Cloud 发布版本系列设置构建系统的详细信息,请参阅 Spring Cloud 项目页面

如果包含 starter,但又不想启用网关,请设置 spring.cloud.gateway.enabled=false

Spring Cloud Gateway 基于 Spring BootSpring WebFluxProject Reactor 构建。因此,当您使用 Spring Cloud Gateway 时,许多您熟悉的同步库(例如 Spring Data 和 Spring Security)和模式可能不适用。如果您不熟悉这些项目,我们建议您在开始使用 Spring Cloud Gateway 之前阅读它们的文档,以熟悉一些新概念。
Spring Cloud Gateway 需要 Spring Boot 和 Spring Webflux 提供的 Netty 运行时。它不能在传统的 Servlet 容器中运行,也不能构建为 WAR 文件。
© . This site is unofficial and not affiliated with VMware.