Spring Cloud Dalston 版本發佈

發佈 | Spencer Gibb | 2017年4月12日 | ...

我在此代表社群,很高興宣布 Spring Cloud Dalston 版本列車的正式發佈 (RELEASE) 今天正式上線。此版本可在 Maven Central 找到。您可以查看 Dalston 的發佈說明以取得更多資訊

Dalston 版本列車的重大變更

Vault

Spring Cloud Vault Config 是一個新專案,透過 Hashicorp Vault,為分散式系統中的外部化密鑰管理提供用戶端支援。

Config Server

Config Server 現在透過複合模式支援多個後端。這允許先前不可能的後端類型組合,例如:Vault 和 git 或多個 git 後端。現在支援對 AWS Codecommit 託管的 git 儲存庫進行驗證。在先前的 (Camden) 版本中,Hashicorp Vault 已新增為 Config Server 的後端,與基於 VCS 的後端並行。

Spring Cloud Commons

自核心 Spring Cloud 模組(Commons、Config、Netflix、Bus)開始以來,DiscoveryClient 的實作已自動將執行中的用戶端註冊到服務發現伺服器。這是最初 Netflix Eureka 實作的副作用。現在,服務註冊與已註冊服務的發現是獨立的考量。現在有一個 ServiceRegistry 介面,Spring Cloud Netflix、Consul 和 Zookeeper 都實作了這個介面。預設情況下,用戶端仍然會自動註冊,但可以透過 @EnableDiscoveryClientautoRegister 屬性或透過屬性動態停用此功能。這也允許每個 JVM 註冊多個服務,以程式設計方式進行。請關注未來的部落格文章以了解更多詳細資訊。基於組態的 DiscoveryClient 也已可用。

社群貢獻了對 @LoadBalanced AsyncRestTemplate 的支援。

Sleuth

通用內容傳播系統的支援已新增至 Sleuth。它被稱為「行李 (baggage)」,並允許使用 Sleuth 已建置的檢測功能,透過邊界(例如 HTTP 或訊息傳遞)傳遞任意屬性。

另一個功能是基於註解的 Span 建立以及日誌和標籤的添加。這不僅產生更少的樣板程式碼,而且在與在運行時產生實作的框架(例如 Spring Data)一起工作時也很有用。

Contract

Contract 經過增強,可支援更靈活的契約輸入和輸出。新增了 Pact 支援,用於讀取契約,而不是 Groovy DSL。Contract 變得更具可插拔性,允許自訂 DSL 格式、測試與 Stub 產生,以及 Stub Runner 實作。

Consul

除了支援新的 ServiceRegistry API 之外,Spring Cloud Consul 還支援 Consul 功能,以取消註冊殭屍服務(即,在可設定的時間量內健康檢查失敗的服務將從 Consul 中移除)。

其他

Dalston 基於 Spring Boot 1.5.x,這是最低要求版本。其他變更包括升級到各種函式庫、錯誤修復、文件和潤飾。非常感謝社群對 Pull Request 和問題的所有貢獻。

以下模組已更新,作為 Dalston.RELEASE 的一部分

模組 版本
Spring Cloud AWS 1.2.0.RELEASE
Spring Cloud Build 1.3.1.RELEASE
Spring Cloud Bus 1.3.0.RELEASE
Spring Cloud Cloudfoundry 1.1.0.RELEASE
Spring Cloud Commons 1.2.0.RELEASE
Spring Cloud Config 1.3.0.RELEASE
Spring Cloud Consul 1.2.0.RELEASE
Spring Cloud Contract 1.1.0.RELEASE
Spring Cloud Netflix 1.3.0.RELEASE
Spring Cloud Security 1.2.0.RELEASE
Spring Cloud Sleuth 1.2.0.RELEASE
Spring Cloud Stream Chelsea.SR1
Spring Cloud Task 1.1.1.RELEASE
Spring Cloud Vault Config 1.0.0.RELEASE
Spring Cloud Zookeeper 1.1.0.RELEASE
Spring Cloud Thin Launcher 1.1.0.RELEASE
Spring Cloud CLI 1.3.0.RELEASE

而且,如同往常,我們歡迎各方意見回饋:無論是在 GitHubGitterStack OverflowTwitter 上。

開始使用 Maven 和 BOM (僅限相依性管理)

<dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>org.springframework.cloud</groupId>
      <artifactId>spring-cloud-dependencies</artifactId>
      <version>Dalston.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-eureka</artifactId>
  </dependency>
  ...
</dependencies>

或使用 Gradle

buildscript {
  dependencies {
    classpath "io.spring.gradle:dependency-management-plugin:1.0.0.RELEASE"
  }
}
apply plugin: "io.spring.dependency-management"

dependencyManagement {
  imports {
    mavenBom 'org.springframework.cloud:spring-cloud-dependencies:Dalston.RELEASE'
  }
}

dependencies {
    compile 'org.springframework.cloud:spring-cloud-starter-config'
    compile 'org.springframework.cloud:spring-cloud-starter-eureka'
    ...
}

取得 Spring 電子報

隨時掌握 Spring 電子報的最新消息

訂閱

領先一步

VMware 提供訓練和認證,以加速您的進展。

了解更多

取得支援

Tanzu Spring 在一個簡單的訂閱中提供 OpenJDK™、Spring 和 Apache Tomcat® 的支援和二進位檔案。

了解更多

即將到來的活動

查看 Spring 社群中所有即將到來的活動。

檢視全部