領先一步
VMware 提供培訓和認證,助力您的發展。
瞭解更多我代表社群高興地宣佈,Spring Cloud 2022.0 釋出列的正式釋出 (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 和安全問題,並考慮和審查來自社群的小型拉取請求。
@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 | (問題) |
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 | (問題) |
一如既往,我們歡迎在 GitHub、Gitter、Stack Overflow 或 Twitter 上提供反饋。
使用 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}"
}
}