如何引入 Spring Cloud Gateway
要在您的專案中引入 Spring Cloud Gateway,請使用組 ID 為 org.springframework.cloud
、Artifact ID 為 spring-cloud-starter-gateway
的 Starter。有關使用當前的 Spring Cloud Release Train 設定構建系統的詳細資訊,請參閱 Spring Cloud 專案頁面。
如果您引入了 Starter,但不想啟用閘道器,請設定 spring.cloud.gateway.enabled=false
。
Spring Cloud Gateway 基於 Spring Boot、Spring WebFlux 和 Project Reactor 構建。因此,在使用 Spring Cloud Gateway 時,許多您熟悉的同步庫(例如 Spring Data 和 Spring Security)和模式可能不適用。如果您不熟悉這些專案,我們建議您在開始使用 Spring Cloud Gateway 之前先閱讀它們的文件,熟悉一些新概念。 |
Spring Cloud Gateway 需要由 Spring Boot 和 Spring Webflux 提供的 Netty 執行時。它不能在傳統的 Servlet 容器中工作,也不能構建成 WAR。 |