领先一步
VMware 提供培训和认证,助您加速进步。
了解更多我谨代表社区,很高兴地宣布 Spring Cloud 2022.0 Release Train 的通用可用性 (RELEASE) 版本今天发布。您可以在 Maven Central 中找到该版本。您可以查看 2022.0 的发行说明以获取更多信息。
Spring Cloud 2022.0.0 是一个主要版本,建立在 Spring Framework 6.x 和 Spring Boot 3.x 的基础上。它包含了对 Jakarta EE 的兼容性,并需要 Java 17 作为基线。请在此处查看此版本中包含的问题列表。以下是 2022.0.0 的所有里程碑、候选版本和 GA 版本中的亮点。
由于 Spring 现在提供了自己的接口 HTTP 客户端解决方案,从 2022.0.0 开始,我们将把 Spring Cloud OpenFeign 视为功能完备。这意味着 Spring Cloud 团队将不再为该模块添加新功能。我们仍然会修复 bug 和安全问题,并且还会考虑和审查社区提交的小型 pull request。
@ConditionalOnKubernetesEnabled 的使用,转而使用 Spring Boot 的 @ConditionalOnCloudPlatform(893)spring.config.import 加载 Config Maps 和 Secrets,消除了使用 Bootstrap context 的需求(1002)ServiceInstance 自定义负载均衡的请求(#735)12.0(#782)12.1(#792)ResponseInterceptor 的可能性(#802)添加了注册生命周期监听器(#999)
为阻塞的 LoadBalancer 客户端请求提供了请求数据上下文,可用于生命周期回调(#1090)
OAuth 集成已从已弃用的 Spring Security OAuth 迁移到 Spring Security 中的 OAuth2 支持(#1053)
添加了注册生命周期监听器(#999https://github.com/spring-cloud/spring-cloud-commons/issues/999)
为阻塞的 LoadBalancer 客户端请求提供了请求数据上下文,可用于生命周期回调(#1090)
增加了优先创建 LoadBalancer 子上下文的可能性(#729)
添加了基于权重的负载均衡(#1063)
在 AOT 和原生镜像支持中添加了对 LoadBalancer 子上下文的支持(#1135)
添加了对基于属性配置的加权负载均衡的支持(#1163)
移除了依赖于 Apache HttpClient v4 的接口。移除了 OK HttpClient 接口,因为它们仅被 Spring Cloud OpenFeign 使用。Spring Cloud OpenFeign 现在直接使用 OK HttpClient(#1171)
已移除已弃用的类和接口。请参阅Spring Cloud 2022 发行说明中的重大变更。
在 AOT 模式下切换为延迟初始化子上下文(#1176)
src/test/resources/contracts 检查的支持 (#1848)以下模块已在 2022.0.0 版本中更新
| 模块 | 版本 | 问题 |
|---|---|---|
| Spring Cloud Vault | 4.0.0 | (issues) |
| Spring Cloud Kubernetes | 3.0.0 | (issues) |
| Spring Cloud Function | 4.0.0 | |
| Spring Cloud Zookeeper | 4.0.0 | |
| Spring Cloud Circuitbreaker | 3.0.0 | (issues) |
| Spring Cloud Task | 3.0.0 | |
| Spring Cloud Bus | 4.0.0 | |
| Spring Cloud Stream | 4.0.0 | |
| Spring Cloud Openfeign | 4.0.0 | (issues) |
| Spring Cloud Commons | 4.0.0 | (issues) |
| Spring Cloud Contract | 4.0.0 | |
| Spring Cloud Starter Build | 2022.0.0 | |
| Spring Cloud Netflix | 4.0.0 | (issues) |
| Spring Cloud Consul | 4.0.0 | |
| Spring Cloud Config | 4.0.0 | (issues) |
| Spring Cloud Build | 4.0.0 | |
| Spring Cloud Gateway | 4.0.0 | (issues) |
一如既往,我们欢迎大家在 GitHub、Gitter、Stack Overflow 或 Twitter 上提供反馈。
Maven 起步使用 BOM(仅依赖管理)
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>2022.0.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
...
</dependencies>
或使用 Gradle
plugins {
id 'java'
id 'org.springframework.boot' version '3.0.0'
id 'io.spring.dependency-management' version '1.1.0'
}
repositories {
mavenCentral()
}
ext {
set('springCloudVersion', "2022.0.0")
}
dependencies {
implementation 'org.springframework.cloud:spring-cloud-starter-config'
implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'
}
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}