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 社群所有即將舉行的活動。

檢視所有