如何理解Spring Cloud Alibaba組件,相信很多沒有經(jīng)驗的人對此束手無策,為此本文總結(jié)了問題出現(xiàn)的原因和解決方法,通過這篇文章希望你能解決這個問題。

創(chuàng)新互聯(lián)-專業(yè)網(wǎng)站定制、快速模板網(wǎng)站建設(shè)、高性價比鉛山網(wǎng)站開發(fā)、企業(yè)建站全套包干低至880元,成熟完善的模板庫,直接使用。一站式鉛山網(wǎng)站制作公司更省心,省錢,快速模板網(wǎng)站建設(shè)找我們,業(yè)務(wù)覆蓋鉛山地區(qū)。費(fèi)用合理售后完善,十多年實體公司更值得信賴。
1.SpringCloud Alibaba概述
Spring Cloud Alibaba 致力于提供微服務(wù)開發(fā)的一站式解決方案。此項目包含開發(fā)分布式應(yīng)用微服務(wù)的必需組件,方便開發(fā)者通過 Spring Cloud 編程模型輕松使用這些組件來開發(fā)分布式應(yīng)用服務(wù)。
依托 Spring Cloud Alibaba,您只需要添加一些注解和少量配置,就可以將 Spring Cloud 應(yīng)用接入阿里微服務(wù)解決方案,通過阿里中間件來迅速搭建分布式應(yīng)用系統(tǒng)。
Spring Cloud的幾大痛點
部分環(huán)境搭建起來比較復(fù)雜,沒有非常友好的可視化界面
配置相對來說復(fù)雜,需要較高的學(xué)習(xí)成本
Spring Cloud Alibaba的優(yōu)勢
PassJava項目搭配SpringCloud Alibaba技術(shù)的搭配方案
| 描述 | Spring Cloud | Spring Cloud Alibaba | 組合選用 |
|---|---|---|---|
| 服務(wù)發(fā)現(xiàn)組件 | Eureka(停止維護(hù))服務(wù)發(fā)現(xiàn)組件 | Nacos 注冊中心 | Spring Cloud Alibaba - Nacos |
| 配置中心組件 | Spring Cloud Config 配置中心 | Nacos 配置中心 | Spring Cloud Alibaba - Nacos |
| 斷路保護(hù)組件 | Hystrix 斷路保護(hù) | Sentinel 服務(wù)容錯 | Spring Cloud Alibaba - Sentinel |
| 鏈路追蹤組件 | Sleuth 調(diào)用鏈監(jiān)控 | / | Spring Cloud - Sleuth |
| 負(fù)載均衡組件 | Ribbon | / | Spring Cloud - Ribbon |
| 遠(yuǎn)程調(diào)用組件 | OpenFeign (HTTP+JSON) | Dubbo(RPC框架) | Spring Cloud - OpenFeign |
| 分布式事務(wù) | / | Seata 分布式事務(wù) | Spring Cloud Alibaba - Seata |
| API 網(wǎng)關(guān) | Gateway | / | Spring Cloud - Gateway |
最后技術(shù)選型:
Spring Cloud Alibaba - Nacos 實現(xiàn)注冊中心
Spring Cloud Alibaba - Nacos 實現(xiàn)配置中心
Spring Cloud Alibaba - Sentinel 實現(xiàn)服務(wù)容錯
Spring Cloud Alibaba - Seata 實現(xiàn)分布式事務(wù)
Spring Cloud - Ribbon 實現(xiàn)負(fù)載均衡
Spring Cloud - Feign 實現(xiàn)遠(yuǎn)程調(diào)用
Spring Cloud - Gateway API網(wǎng)關(guān)
Spring Cloud - Sleuth 實現(xiàn)調(diào)用鏈監(jiān)控
項目的版本號格式為 x.x.x 的形式,其中 x 的數(shù)值類型為數(shù)字,從 0 開始取值,且不限于 0~9 這個范圍。項目處于孵化器階段時,第一位版本號固定使用 0,即版本號為 0.x.x 的格式。
由于 Spring Boot 1 和 Spring Boot 2 在 Actuator 模塊的接口和注解有很大的變更,且 spring-cloud-commons 從 1.x.x 版本升級到 2.0.0 版本也有較大的變更,因此阿里采取跟 SpringBoot 版本號一致的版本:
Spring Cloud Alibaba 版本和Spring Cloud 和Spring Boot 版本兼容性列表
| Spring Cloud 版本 | Spring Cloud Alibaba 版本 | Spring Boot 版本 |
|---|---|---|
| Spring Cloud Hoxton.SR3 | 2.2.x.RELEASE | 2.2.x.RELEASE |
| Spring Cloud Greenwich | 2.1.x.RELEASE | 2.1.x.RELEASE |
| Spring Cloud Finchley | 2.0.x.RELEASE | 2.0.x.RELEASE |
| Spring Cloud Edgware | 1.5.x.RELEASE | 1.5.x.RELEASE |
我們采用Spring Cloud Hoxton.SR3, Spring Cloud Alibaba 2.2.0.RELEASE, Spring Boot 2.2.6 RELEASE
PassJava-Common的pom.xml文件引入Spring Cloud Alibaba依賴
<dependencyManagement>
<dependencies>
<!-- Spring Cloud Alibaba 依賴 -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
<version>2.2.0.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>看完上述內(nèi)容,你們掌握如何理解Spring Cloud Alibaba組件的方法了嗎?如果還想學(xué)到更多技能或想了解更多相關(guān)內(nèi)容,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝各位的閱讀!
網(wǎng)站欄目:如何理解SpringCloudAlibaba組件
地址分享:http://www.chinadenli.net/article0/gidgoo.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供關(guān)鍵詞優(yōu)化、用戶體驗、網(wǎng)頁設(shè)計公司、企業(yè)網(wǎng)站制作、網(wǎng)站收錄、網(wǎng)站營銷
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)