什么是Spring Cloud Alibaba
Spring Cloud Alibaba 致力于提供微服务开发的一站式解决方案。此项目包含开发分布式应用服务的必需组件,方便开发者通过 Spring Cloud 编程模型轻松使用这些组件来开发分布式应用服务。
依托 Spring Cloud Alibaba,您只需要添加一些注解和少量配置,就可以将 Spring Cloud 应用接入阿里分布式应用解决方案,通过阿里中间件来迅速搭建分布式应用系统。
什么是Spring Cloud Alibaba:
阿里巴巴结合自身微服务实践,开源的微服务全家桶在Spring Cloud项目中孵化,是Spring Cloud的子项目,很有可能成为Spring Cloud第二代的标准实现许多组件在业界逐渐开始使用,已有很多成功案例Spring Cloud Alibaba应用场景:
大型复杂的系统,例如大型电商系统高并发系统,例如大型门户及秒杀系统等需求不明确,且变更很快的系统,例如创业公司的业务系统Spring Cloud Alibaba和Spring Cloud的区别和联系:
Spring Cloud Alibaba是Spring Cloud的子项目,Spring Cloud Alibaba实现了Spring Cloud的标准;下图大致对比了两者的区别:Spring Cloud标准所提供的功能:
Spring Cloud Alibaba基于Spring Cloud标准所实现的主要的功能组件:
Spring Cloud Alibaba相比于Spring Cloud:
组件性能更强良好的可视化界面搭建简单,学习曲线低文档丰富并且是中文的Spring Cloud Alibaba的官方GitHub仓库地址:
https://github.com/alibaba/spring-cloud-alibaba
不管是Spring Cloud还是Spring Cloud Alibaba都是为了提供微服务开发的一站式解决方案,让微服务架构的开发更简单、方便。
那么如何在项目中整合Spring Cloud Alibaba呢?很简单,首先创建一个Spring Boot项目,然后在pom.xml文件中加入如下依赖管理即可:
<dependencyManagement> <dependencies> <!--整合Spring Cloud--> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-dependencies</artifactId> <version>${spring-cloud.version}</version> <type>pom</type> <scope>import</scope> </dependency> <!--整合Spring Cloud Alibaba--> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-alibaba-dependencies</artifactId> <version>${spring-cloud-alibaba.version}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies></dependencyManagement>
添加完以上配置后就可以在dependencies里添加Spring Cloud Alibaba相关组件的依赖项了,需要注意的是目前Spring Cloud Alibaba还没有正式孵化,所以Spring Cloud Alibaba与Spring Cloud的版本还存在依赖关系。关于版本之间的依赖关系及版本选择可以参考官方文档的版本说明
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。