领先一步
VMware 提供培训和认证,助您加速进步。
了解更多我很高兴代表社区宣布 Spring Cloud Greenwich Release Train 的通用可用性 (RELEASE) 版本今日发布。您可以在 Maven Central 中找到此版本。您可以查看 Greenwich 版本说明以获取更多信息。
Edgware release train 将于 2019 年 8 月 1 日达到 EOL(生命周期结束)状态。您可以在 这里 阅读正式公告。
Spring Cloud Finchley 发布版本周期被视为一个主要版本,并且与 Spring Boot 2.0.x 版本相关联。因此,当 Spring Boot 2.0.x 版本分支被标记为 EOL(生命周期结束)时,Spring Cloud Finchley 发布版本周期也将达到 EOL 状态。一旦确定日期,我们将在本博客上发布相关公告。
Spring Cloud Greenwich 发布版本周期被视为一个次要版本,并将继续支持 Spring Boot 2.x 版本分支。
所有项目都进行了更新以兼容 Java 11。
Greenwich 发布版本周期包含两个新项目:Spring Cloud GCP(提供与 Google Cloud Platform 的集成)和 Spring Cloud Kubernetes(提供与 Kubernetes 的集成)。
最近,Netflix 宣布 Hystrix 进入维护模式。Ribbon 自 2016 年以来一直处于 类似状态。尽管 Hystrix 和 Ribbon 现在处于维护模式,但它们仍在 Netflix 大规模部署。
Hystrix Dashboard 和 Turbine 已被 Atlas 取代。这些项目最后一次提交是在两年前和四年前。Zuul 1 和 Archaius 1 都已被不向后兼容的后续版本取代。
以下 Spring Cloud Netflix 模块和相应的启动器将进入维护模式:
这不包括 Eureka 或 concurrency-limits 模块。
将一个模块置于维护模式意味着 Spring Cloud 团队将不再为该模块添加新功能。我们将修复阻塞性 bug 和安全问题,并且还会考虑和审查社区提交的小型拉取请求。
我们打算在 Greenwich 发布版本周期 正式发布后,**至少**支持这些模块一年。
我们建议使用以下方案来替代这些模块提供的功能。
| 当前 | 替代方案 |
|---|---|
| Hystrix | Resilience4j |
| Hystrix Dashboard / Turbine | Micrometer + Monitoring System |
| Ribbon | Spring Cloud Loadbalancer |
| Zuul 1 | Spring Cloud Gateway |
| Archaius 1 | Spring Boot 外部配置 + Spring Cloud Config |
请关注后续关于 Spring Cloud Loadbalancer 以及与新的 Netflix 项目 Concurrency Limits 集成的博客文章。
请参阅 Google 的 发布公告。
ServiceInstance.instanceId 字段的支持。ServiceInstance.instanceId 字段的支持。请参阅 Spring Cloud Stream 的 发布公告。
ServiceInstance.instanceId 字段的支持。请参阅 Spring Cloud Task 的 发布公告。
ServiceInstance 元数据,使其来自 Kubernetes Labels、Annotations 和 Ports。KubernetesDiscoveryClient 的使用。EnvironmentRepository 以支持 CredHub 后端。@QueryMap 注解的支持。ServiceInstance 接口中添加了 instanceId。ReactiveLoadBalancer 接口,并使用 Reactor 实现。以下模块已作为 Greenwich.RELEASE 的一部分进行了更新:
| Module | Version | Issues |--- |--- |--- |--- | Spring Cloud Sleuth | 2.1.0.RELEASE | (issues) | Spring Cloud Gcp | 1.1.0.RELEASE | (issues) | Spring Cloud Build | 2.1.2.RELEASE | | Spring Cloud Netflix | 2.1.0.RELEASE | (issues) | Spring Cloud Consul | 2.1.0.RELEASE | | Spring Cloud Gateway | 2.1.0.RELEASE | (issues) | Spring Cloud | Greenwich.RELEASE | | Spring Cloud Function | 2.0.0.RELEASE | (issues) | Spring Cloud Stream | Fishtown.RELEASE | | Spring Cloud Zookeeper | 2.1.0.RELEASE | | Spring Cloud Cloudfoundry | 2.1.0.RELEASE | | Spring Cloud Aws | 2.1.0.RELEASE | | Spring Cloud Task | 2.1.0.RELEASE | | Spring Cloud Kubernetes | 1.0.0.RELEASE | (issues) | Spring Cloud Contract | 2.1.0.RELEASE | (issues) | Spring Cloud Release | Greenwich.RELEASE | | Spring Cloud Security | 2.1.0.RELEASE | | Spring Cloud Starter | Greenwich.RELEASE | | Spring Cloud Bus | 2.1.0.RELEASE | (issues) | Spring Cloud Config | 2.1.0.RELEASE | (issues) | Spring Cloud Vault | 2.1.0.RELEASE | (issues) | Spring Cloud Openfeign | 2.1.0.RELEASE | (issues) | Spring Cloud Commons | 2.1.0.RELEASE | | Spring Cloud Dependencies | 2.1.2.RELEASE |
一如既往,我们欢迎在 GitHub、Gitter、Stack Overflow 和 Twitter 上提供反馈。
Maven 起步使用 BOM(仅依赖管理)
<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'
...
}