Spring Cloud Greenwich.RELEASE
現已正式發布,可以在 Spring Milestone 和 Maven Central 庫獲取到。也可以查看 Greenwich 發布說明了解更多信息。
壽命終止(EOL)提醒
Edgware 版本將於 2019 年 8 月 1日進入 EOL 狀態。詳細說明參見 Spring Cloud Edgware 將在2019年8月1號 EOL。
Spring Cloud Finchley 發布版本是目前的主要版本,與 Spring Boot 2.0.x 版本保持一致。因此,Spring Cloud Finchley 的版本發布將隨着 Spring Boot 2.0.x 版本分鍾進入 EOL 而相應終止維護。當明確的時間確定之后,具體的宣布聲明屆時將會以博客文章的形式發布出來。
Spring Cloud Greenwich 發布版本是一個小版本,將會持續提供支持一直到 Spring Boot 2.x 分支結束。
Greenwich 版本值得注意的更新
所有相關的項目也都已經兼容 Java 11。
新項目
Greenwich 包括了兩個新項目: Spring Cloud GCP
和 Spring Cloud Kubernetes
. 前者為 Google Cloud Platform(GCP)的服務提供了集成支持,后者提供了 Kubernetes 的集成。
Spring Cloud Netflix 項目進入維護模式
最近,Netflix 宣布 Hystrix 正在進入維護模式。自 2016 年以來,Ribbon 也已處於類似狀態。雖然 Hystrix 和 Ribbon 現在處於維護模式,但它們仍然在 Netflix 上大規模部署。
Hystrix Dashboard 和 Turbine 已被 Atlas 取代。這些項目的最后提交分別是 2 年和 4 年前。Zuul 1 和 Archaius 1 都被后來不兼容的版本所取代。
以下 Spring Cloud Netflix 模塊和相應的起步依賴將進入維護模式:
-
spring-cloud-netflix-archaius
-
spring-cloud-netflix-hystrix-contract
-
spring-cloud-netflix-hystrix-dashboard
-
spring-cloud-netflix-hystrix-stream
-
spring-cloud-netflix-hystrix
-
spring-cloud-netflix-ribbon
-
spring-cloud-netflix-turbine-stream
-
spring-cloud-netflix-turbine
-
spring-cloud-netflix-zuul
這不包括 Eureka 或並發限制模塊。
什么是維護模式?
將模塊置於維護模式意味着 Spring Cloud 團隊將不再向模塊添加新功能。我們將修復重大程序錯誤和安全問題,我們還將考慮並審查社區的小的拉取請求(PR)。
我們打算繼續支持這些模塊,從 Greenwich 正式發布可用之后算起至少一年的時間。
替代項目
我們建議將以下內容替換為這些模塊提供的功能。
查看有關 Spring Cloud Loadbalancer 的后續博客文章,並與新的 Netflix 項目 Concurrency Limits 集成。
Spring Cloud Sleuth
-
升級到最新的 Brave 庫
-
WebFlux 和 Reactor 集成的性能得到提升
-
支持 gRPC 插樁檢測
-
增加了對多個跨度報告的支持
-
增加了限速采樣器支持
Spring Cloud GCP
詳見 Google 產品和服務介紹
Spring Cloud Netflix
-
升級 Ribbon 和 Eureka 的版本
-
增加了新的字段
ServiceInstance.instanceId
Spring Cloud Consul
-
增加了新的字段
ServiceInstance.instanceId
Spring Cloud Gateway
-
增加可重寫響應頭的過濾器
-
在各自的路由謂詞中為多個路徑和主機添加了支持,並且可以自定義在某些情況下返回的 HTTP 狀態碼
Spring Cloud Function
-
支持 Kotlin
-
為 Azure 函數提供的新編程模型
-
在 Web 適配器啟動時自動(可選)導出Supplier
-
函數式 Bean 的注冊
-
更多介紹
Spring Cloud Stream
-
詳見 發布說明
Spring Cloud Zookeeper
-
增加新的字段
ServiceInstance.instanceId
Spring Cloud Task
-
詳見 發布說明
Spring Cloud Kubernetes
-
現在可以將 ServiceInstance 元數據配置為來自 Kubernetes Labels、Annotations 和 Ports
-
在引導期間使用 KubernetesDiscoveryClient 進行了增強
-
添加了一個模塊來檢測 Istio 的存在
Spring Cloud Contract
-
新增支持 XML payloads
-
允許將合同轉儲為通用表示
-
添加了 WebTestClient 支持,用於測試與 WebFlux 的合約
-
改進了 Pact 集成
-
添加了 Camel 支持
-
添加了 JUnit5 支持
-
升級 WireMock 到最新版本
-
添加了二進制負載的支持
-
添加了對 Git 存儲中最新版本的支持
-
允許為正則表達式生成提供顯式類型
Spring Cloud Security
Spring Cloud Gateway 過濾器新增支持 OAuth2。這里有一個簡單 演示程序。
Spring Cloud Config
-
新增
EnvironmentRepository
以支持 CredHub 后端服務
Spring Cloud Vault
-
新增支持 Google Cloud 和 Azure 認證
-
升級到 Spring Vault 2.1.1
Spring Cloud Openfeign
-
支持增加注解
@QueryMap
-
升級到 OpenFeign 10.1.0
Spring Cloud Commons
-
ServiceInstance 接口新增了 instanceId
-
新增
ReactiveLoadBalancer
接口,通過 Reactor 實現
以下模塊作為 Greenwich.RELEASE
的一部分進行了更新:
要使用BOM開始使用Maven(僅限依賴關系管理):
-
<dependencyManagement>
-
<dependencies>
-
<dependency>
-
<groupId>org.springframework.cloud</groupId>
-
<artifactId>spring-cloud-dependencies</artifactId>
-
<version>Greenwich.RELEASE</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:
-
buildscript {
-
dependencies {
-
classpath "io.spring.gradle:dependency-management-plugin:1.0.2.RELEASE"
-
}
}
apply plugin: "io.spring.dependency-management"
dependencyManagement { -
imports {
-
mavenBom 'org.springframework.cloud:spring-cloud-dependencies:Greenwich.RELEASE'
-
}
}
dependencies { -
compile 'org.springframework.cloud:spring-cloud-starter-config'
-
compile 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'
-
...
}
原文: https://spring.io/blog/2019/01/23/spring-cloud-greenwich-release-is-now-available
作者: Ryan Baxter
編譯: 春之雨