Spring Cloud 2022.0.0 (代号 Kilburn) 已发布

版本发布 | Ryan Baxter | 2022年12月16日 | ...

我谨代表社区,很高兴地宣布 Spring Cloud 2022.0 Release Train 的通用可用性 (RELEASE) 版本今天发布。您可以在 Maven Central 中找到该版本。您可以查看 2022.0 的发行说明以获取更多信息

2022.0.0 发布火车中的显著变化

Spring Cloud 2022.0.0 是一个主要版本,建立在 Spring Framework 6.x 和 Spring Boot 3.x 的基础上。它包含了对 Jakarta EE 的兼容性,并需要 Java 17 作为基线。请在此处查看此版本中包含的问题列表。以下是 2022.0.0 的所有里程碑、候选版本和 GA 版本中的亮点。

Spring Cloud OpenFeign 功能完备公告

由于 Spring 现在提供了自己的接口 HTTP 客户端解决方案,从 2022.0.0 开始,我们将把 Spring Cloud OpenFeign 视为功能完备。这意味着 Spring Cloud 团队将不再为该模块添加新功能。我们仍然会修复 bug 和安全问题,并且还会考虑和审查社区提交的小型 pull request。

Spring Cloud Kubernetes

  • 已移除 @ConditionalOnKubernetesEnabled 的使用,转而使用 Spring Boot 的 @ConditionalOnCloudPlatform893
  • 重构了 ConfigMaps 和 Secrets 的实现(#917
  • 使用 spring.config.import 加载 Config Maps 和 Secrets,消除了使用 Bootstrap context 的需求(1002
  • Secrets 和 Config Maps 支持前缀(765
  • 按命名空间过滤服务发现(#1000
  • KubernetesCatalogWatch 应支持命名空间(#1158
  • 升级到 Kubernetes Java Client 17(#1168
  • 更新到 fabric8 6.2.0(#1165
  • 使用 endpoint slices 来处理 fabric8 catalog watcher(#1149

Spring Cloud Function

  • 增加了对 AOT 和原生镜像的支持

Spring Cloud Circuitbreaker

  • 将 Resilience4J 升级到 2.0.2
  • 添加了在运行 Resilient4J 断路器时禁用线程池的支持(147

Spring Cloud Task

  • 了解 Spring Cloud Tasks 中的新变化和变更(发行说明
  • 阅读更多关于如何从 Spring Cloud Task 2.x 迁移到 3.0 的信息(迁移指南

Spring Cloud Stream

  • 增加了对 AOT 和原生镜像的支持

Spring Cloud OpenFeign

  • 允许根据选定的 ServiceInstance 自定义负载均衡的请求(#735
  • 增加了对目标 URL 刷新的支持(#710
  • 增加了对 LoadBalancer X-Forwarded Headers 的支持(#748
  • 默认启用 Jackson 自动配置(#476
  • 移除了已弃用的内容并调整以适应 Feign 的 API 更改(#768
  • 移除了 Spring Cloud Commons HttpClient 接口的使用(#788
  • Apache HttpClient 4 已被移除,转而使用 Apache HttpClient 5(#783
  • 升级到 Feign 12.0#782
  • 添加了对 AOT 和原生镜像的支持(#794
  • 添加了对 Micrometer Observation API 的支持([#793]https://github.com/spring-cloud/spring-cloud-openfeign/pull/793
  • Feign 已升级到 Feign 12.1#792
  • 增加了配置 ResponseInterceptor 的可能性(#802

Spring Cloud Commons

  • 添加了注册生命周期监听器(#999

  • 为阻塞的 LoadBalancer 客户端请求提供了请求数据上下文,可用于生命周期回调(#1090

  • OAuth 集成已从已弃用的 Spring Security OAuth 迁移到 Spring Security 中的 OAuth2 支持(#1053

  • 增加了在 LoadBalancer 中针对特定异常进行重试的可能性

  • 添加了注册生命周期监听器(#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

Spring Cloud Contract

Spring Cloud Netflix

  • 更新到 Eureka 2.0.0。Eureka 2.0.0 是 Eureka 的一个新分支,与 7 年前的旧 2.x-archive实验无关。新的2.x分支是为了兼容 JakartaEE。这使得 Spring Cloud Netflix 能够与 Spring Framework 6.0 和 Spring Boot 3.0 兼容。
  • 将 Apache HttpClient 迁移到 Apache HC5 HttpClient(#4126

Spring Cloud Consul

  • 增加了对 AOT 和原生镜像的支持

Spring Cloud Config

Spring Cloud Gateway

  • 增加了对 AOT 和原生镜像的支持
  • 添加了 LocalResponseCache 过滤器(2759
  • 添加了 micrometer Observability 支持(2715

以下模块已在 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)

一如既往,我们欢迎大家在 GitHubGitterStack OverflowTwitter 上提供反馈。

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}"
  }
}

获取 Spring 新闻通讯

通过 Spring 新闻通讯保持联系

订阅

领先一步

VMware 提供培训和认证,助您加速进步。

了解更多

获得支持

Tanzu Spring 提供 OpenJDK™、Spring 和 Apache Tomcat® 的支持和二进制文件,只需一份简单的订阅。

了解更多

即将举行的活动

查看 Spring 社区所有即将举行的活动。

查看所有