一、什么是Spring Cloud Alibaba
Spring Cloud Alibaba 致力于提供微服務(wù)開發(fā)的一站式解決方案墙杯。此項目包含開發(fā)分布式應(yīng)用服務(wù)的必需組件,方便開發(fā)者通過 Spring Cloud 編程模型輕松使用這些組件來開發(fā)分布式應(yīng)用服務(wù)舅逸。
依托 Spring Cloud Alibaba蹬碧,您只需要添加一些注解和少量配置昂灵,就可以將 Spring Cloud 應(yīng)用接入阿里分布式應(yīng)用解決方案避凝,通過阿里中間件來迅速搭建分布式應(yīng)用系統(tǒng)
二、主要功能
服務(wù)限流降級:默認(rèn)支持 WebServlet眨补、WebFlux, OpenFeign管削、RestTemplate、Spring Cloud Gateway, Zuul, Dubbo 和 RocketMQ 限流降級功能的接入撑螺,可以在運(yùn)行時通過控制臺實時修改限流降級規(guī)則含思,還支持查看限流降級 Metrics 監(jiān)控。
服務(wù)注冊與發(fā)現(xiàn):適配 Spring Cloud 服務(wù)注冊與發(fā)現(xiàn)標(biāo)準(zhǔn)甘晤,默認(rèn)集成了 Ribbon 的支持含潘。
分布式配置管理:支持分布式系統(tǒng)中的外部化配置,配置更改時自動刷新线婚。
消息驅(qū)動能力:基于 Spring Cloud Stream 為微服務(wù)應(yīng)用構(gòu)建消息驅(qū)動能力遏弱。
分布式事務(wù):使用 @GlobalTransactional 注解, 高效并且對業(yè)務(wù)零侵入地解決分布式事務(wù)問題塞弊。漱逸。
阿里云對象存儲:阿里云提供的海量、安全游沿、低成本饰抒、高可靠的云存儲服務(wù)。支持在任何應(yīng)用诀黍、任何時間袋坑、任何地點存儲和訪問任意類型的數(shù)據(jù)。
分布式任務(wù)調(diào)度:提供秒級眯勾、精準(zhǔn)咒彤、高可靠、高可用的定時(基于 Cron 表達(dá)式)任務(wù)調(diào)度服務(wù)咒精。同時提供分布式的任務(wù)執(zhí)行模型镶柱,如網(wǎng)格任務(wù)。網(wǎng)格任務(wù)支持海量子任務(wù)均勻分配到所有 Worker(schedulerx-client)上執(zhí)行模叙。
阿里云短信服務(wù):覆蓋全球的短信服務(wù)歇拆,友好、高效、智能的互聯(lián)化通訊能力故觅,幫助企業(yè)迅速搭建客戶觸達(dá)通道厂庇。
三、組件
Sentinel:把流量作為切入點输吏,從流量控制权旷、熔斷降級、系統(tǒng)負(fù)載保護(hù)等多個維度保護(hù)服務(wù)的穩(wěn)定性贯溅。
Nacos:一個更易于構(gòu)建云原生應(yīng)用的動態(tài)服務(wù)發(fā)現(xiàn)拄氯、配置管理和服務(wù)管理平臺。
RocketMQ:一款開源的分布式消息系統(tǒng)它浅,基于高可用分布式集群技術(shù)译柏,提供低延時的、高可靠的消息發(fā)布與訂閱服務(wù)姐霍。
Dubbo:Apache Dubbo? 是一款高性能 Java RPC 框架鄙麦。
Seata:阿里巴巴開源產(chǎn)品,一個易于使用的高性能微服務(wù)分布式事務(wù)解決方案镊折。
Alibaba Cloud ACM:一款在分布式架構(gòu)環(huán)境中對應(yīng)用配置進(jìn)行集中管理和推送的應(yīng)用配置中心產(chǎn)品胯府。
Alibaba Cloud OSS: 阿里云對象存儲服務(wù)(Object Storage Service,簡稱 OSS)恨胚,是阿里云提供的海量盟劫、安全、低成本与纽、高可靠的云存儲服務(wù)侣签。您可以在任何應(yīng)用、任何時間急迂、任何地點存儲和訪問任意類型的數(shù)據(jù)影所。
Alibaba Cloud SchedulerX: 阿里中間件團(tuán)隊開發(fā)的一款分布式任務(wù)調(diào)度產(chǎn)品,提供秒級僚碎、精準(zhǔn)猴娩、高可靠、高可用的定時(基于 Cron 表達(dá)式)任務(wù)調(diào)度服務(wù)勺阐。
Alibaba Cloud SMS: 覆蓋全球的短信服務(wù)卷中,友好、高效渊抽、智能的互聯(lián)化通訊能力蟆豫,幫助企業(yè)迅速搭建客戶觸達(dá)通道。
四懒闷、版本說明
1十减、版本依賴關(guān)系(推薦使用)
Spring Cloud Version | Spring Cloud Alibaba Version | Spring Boot Version |
---|---|---|
Spring Cloud Hoxton | 2.2.0.RELEASE | 2.1.X.RELEASE |
Spring Cloud Greenwich | 2.1.0.RELEASE | 2.1.X.RELEASE |
Spring Cloud Finchley | 2.0.0.RELEASE | 2.0.X.RELEASE |
Spring Cloud Edgware | 1.5.0.RELEASE | 1.5.X.RELEASE |
2栈幸、組件版本關(guān)系
Spring Cloud Alibaba Version | Sentinel Version | Nacos Version | RocketMQ Version | Dubbo Version | Seata Version |
---|---|---|---|---|---|
(畢業(yè)版本) 2.1.0.RELEASE or 2.0.0.RELEASE or 1.5.0.RELEASE | 1.6.3 | 1.1.1 | 4.4.0 | 2.7.3 | 0.7.1 |
(孵化器版本) 0.9.0.RELEASE or 0.2.2.RELEASE or 0.1.2.RELEASE | 1.5.2 | 1.0.0 | 4.4.0 | 2.7.1 | 0.4.2 |
(孵化器版本) 0.2.1.RELEASE or 0.1.1.RELEASE | 1.4.0 | 0.6.2 | 4.3.1 | ? | ? |
(孵化器版本) 0.2.0.RELEASE or 0.1.0.RELEASE | 1.3.0-GA | 0.3.0 | ? | ? | ? |
五、依賴管理
1帮辟、Spring Cloud Greenwich
如果需要使用 Spring Cloud Greenwich 版本速址,請在 dependencyManagement 中添加如下內(nèi)容
<pre spellcheck="false" class="md-fences md-end-block ty-contain-cm modeLoaded" lang="" cid="n95" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace; margin-top: 0px; margin-bottom: 20px; font-size: 0.9rem; display: block; break-inside: avoid; text-align: left; white-space: normal; background: rgb(51, 51, 51); position: relative !important; padding: 10px 10px 10px 30px; width: inherit; color: rgb(184, 191, 198); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"><dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
<version>2.1.0.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency></pre>
2、Spring Cloud Finchley
如果需要使用 Spring Cloud Finchley 版本由驹,請在 dependencyManagement 中添加如下內(nèi)容
<pre spellcheck="false" class="md-fences md-end-block ty-contain-cm modeLoaded" lang="" cid="n98" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace; margin-top: 0px; margin-bottom: 20px; font-size: 0.9rem; display: block; break-inside: avoid; text-align: left; white-space: normal; background: rgb(51, 51, 51); position: relative !important; padding: 10px 10px 10px 30px; width: inherit; color: rgb(184, 191, 198); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"><dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
<version>2.0.0.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency></pre>
3芍锚、Spring Cloud Edgware
如果需要使用 Spring Cloud Edgware 版本,請在 dependencyManagement 中添加如下內(nèi)容
<pre spellcheck="false" class="md-fences md-end-block ty-contain-cm modeLoaded" lang="" cid="n101" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace; margin-top: 0px; margin-bottom: 20px; font-size: 0.9rem; display: block; break-inside: avoid; text-align: left; white-space: normal; background: rgb(51, 51, 51); position: relative !important; padding: 10px 10px 10px 30px; width: inherit; color: rgb(184, 191, 198); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"><dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
<version>1.5.0.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency></pre>
參考
https://github.com/alibaba/spring-cloud-alibaba/blob/master/README-zh.md