1.SpringCloud概述
1.1.SpringCloud是什么?
Spring Cloud是一系列框架的有序集合如服务发现注册、配置中心、消息总线、负载均衡、熔断器、数据监控等。
Spring并没有重复制造轮子,它只是将目前各家公司开发的比较成熟、经得起实际考验的服务框架组合起来,通过Spring Boot风格进行再封装,屏蔽掉了复杂的配置和实现原理,最终给开发者留出了一套简单易懂、易部署和易维护的分布式系统开发工具包。
SpringCloud是一个相对比较新的微服务框架,2016年才推出1.0的release版本,虽然Spring Cloud时间最短, 但是相比Dubbo等RPC框架, Spring Cloud提供了全套的分布式系统解决方案(微服务开发的”全家桶”)。
1.2.Spring Cloud 和 Spring Boot的关系
Spring boot 是 Spring 的一套快速配置脚手架,可以基于spring boot 快速开发单个微服务;
Spring Cloud是一个基于SpringBoot实现的微服务开发方案;
Spring boot可以离开Spring Cloud独立使用开发项目,但是Spring Cloud离不开Springboot,属于依赖的关系。
2.Spring Cloud Alibaba概述
2.1.Netflix公司项目进入维护模式
有了spring cloud这个微服务的框架,为什么又要使用spring cloud alibaba这个框架了?最重要的原因在于spring cloud中的几乎所有的组件都使用Netflix公司的产品,然后在其基础上做了一层封装。然而Netflix的众多组件在2020年停止维护,所以急需其他的一些替代产品,也就是spring cloud alibaba,目前正处于蓬勃发展的态式,马老师左手双十一,右手阿里开源组件,不仅占据了程序员的购物车,还要攻占大家的开发工具。
2.2.Spring Cloud Alibaba是什么?
同 Spring Cloud 一样,Spring Cloud Alibaba 也是一套微服务解决方案,包含开发微服务的必需组件,方便开发者通过 Spring Cloud 编程模型轻松使用这些组件来开发分布式应用服务。
作为 Spring Cloud 体系下的新实现,Spring Cloud Alibaba 跟Spring Cloud官方的组件或其它的第三方实现如 Netflix, Consul,Zookeeper 等对比,具备了更多的功能:
2.3.Spring Boot和Spring Cloud的版本号说明
-
版本号说明
Spring Cloud是基于Springboot的对应版本号开发的,属于依赖的关系,所以不能都选用最新版本
-
Spring Boot和Spring Cloud的版本号如下:
Spring Boot版本号:https://spring.io/projects/spring-boot#learn
Spring Cloud版本号:https://spring.io/projects/spring-cloud#learn
Spring Cloud Alibaba版本号:https://spring.io/projects/spring-cloud-alibaba#learn
-
下表为按时间顺序发布的 Spring Cloud Alibaba 以及对应的适配 Spring Cloud 和 Spring Boot 版本关系:
Spring Cloud Alibaba Version Spring Cloud Version Spring Boot Version 2021.0.1.0 Spring Cloud 2021.0.1 2.6.3 2.2.7.RELEASE Spring Cloud Hoxton.SR12 2.3.12.RELEASE 2021.1 Spring Cloud 2020.0.1 2.4.2 2.2.6.RELEASE Spring Cloud Hoxton.SR9 2.3.2.RELEASE 2.1.4.RELEASE Spring Cloud Greenwich.SR6 2.1.13.RELEASE 2.2.1.RELEASE Spring Cloud Hoxton.SR3 2.2.5.RELEASE 2.2.0.RELEASE Spring Cloud Hoxton.RELEASE 2.2.X.RELEASE 2.1.2.RELEASE Spring Cloud Greenwich 2.1.X.RELEASE 2.0.4.RELEASE(停止维护,建议升级) Spring Cloud Finchley 2.0.X.RELEASE 1.5.1.RELEASE(停止维护,建议升级) Spring Cloud Edgware 1.5.X.RELEASE