Spring Cloud 2022.0.0 (代號 Kilburn) 已釋出

釋出 | Ryan Baxter | 2022年12月16日 | ...

我代表社群高興地宣佈,Spring Cloud 2022.0 釋出列的正式釋出 (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 和安全問題,並考慮和審查來自社群的小型拉取請求。

Spring Cloud Kubernetes

  • 移除了對 @ConditionalOnKubernetesEnabled 的使用,轉而使用 Spring Boot 的 @ConditionalOnCloudPlatform (893)
  • 重構 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)
  • 為 fabric8 catalog watcher 使用 endpoint slice (#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 Header 的支援 (#748)
  • 將 Jackson Autoconfiguration 預設設定為啟用 (#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 (問題)
Spring Cloud Kubernetes 3.0.0 (問題)
Spring Cloud Function 4.0.0
Spring Cloud Zookeeper 4.0.0
Spring Cloud Circuitbreaker 3.0.0 (問題)
Spring Cloud Task 3.0.0
Spring Cloud Bus 4.0.0
Spring Cloud Stream 4.0.0
Spring Cloud Openfeign 4.0.0 (問題)
Spring Cloud Commons 4.0.0 (問題)
Spring Cloud Contract 4.0.0
Spring Cloud Starter Build 2022.0.0
Spring Cloud Netflix 4.0.0 (問題)
Spring Cloud Consul 4.0.0
Spring Cloud Config 4.0.0 (問題)
Spring Cloud Build 4.0.0
Spring Cloud Gateway 4.0.0 (問題)

一如既往,我們歡迎在 GitHubGitterStack OverflowTwitter 上提供反饋。

使用 BOM (僅依賴管理) 透過 Maven 入門

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

檢視全部