Spring 使用 Zuul 引导 2.4.2 网关 API

Spring Boot 2.4.2 Gateway API with Zuul

我正在尝试使用新的 Spring Boot Starter Parent 2.4.2 构建网关 API,但由于某些原因,spring-cloud-starter-netflix-zuul 似乎不受支持不再适用于新版本!有替代品吗?

来自Spring blog

Zuul 1 and Archaius 1 have both been superseded by later versions that are not backward compatible.

The following Spring Cloud Netflix modules and corresponding starters will be placed into maintenance mode:

  • spring-cloud-netflix-archaius
  • spring-cloud-netflix-hystrix-contract
  • spring-cloud-netflix-hystrix-dashboard
  • spring-cloud-netflix-hystrix-stream
  • spring-cloud-netflix-hystrix
  • spring-cloud-netflix-ribbon
  • spring-cloud-netflix-turbine-stream
  • spring-cloud-netflix-turbine
  • spring-cloud-netflix-zuul

Replacements

We recommend the following as replacements for the functionality provided by these modules.

Current Replacement
Hystrix Resilience4j
Hystrix Dashboard / Turbine Micrometer + Monitoring System
Ribbon Spring Cloud Loadbalancer
Zuul 1 Spring Cloud Gateway
Archaius 1 Spring Boot external config + Spring Cloud Config

因此您需要迁移到 Spring Cloud Gateway。