如何引入 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.