spring cloud alibaba所有组件(看完即入门)
2023-09-27 14:28:31 时间
零、使用前提
创建个聚合项目,里面每个模块是一个独立的springboot项目
springcloud 版本要与 springboot版本对应,否则会报错
我的版本是:
Spring boot : 2.3.2.RELEASE
spring cloud : Hoxton.SR9
spring cloud alibaba:2.2.5.RELEASE
一、使用到的组件介绍
组件 | 作用 |
---|---|
nacos | 注册中心(服务注册与发现)、配置中心(动态配置管理) |
Ribbon | 负载均衡 |
Feign | 声明式Http客户端(调用远程服务) |
Sentinel | 服务容错(限流、降级、熔断) |
Gateway | API网关(webflux编程模式) |
Sleuth | 调用链监控 |
Seata | 原Fescar,即分布式事务解决方案 |
二、在公共模块引入依赖
1、每个微服务项目都会有个公共的模块,用于引一些公用的依赖、配置
2、引入这个依赖,spring-cloud-alibaba 其他的依赖就不用写版本号
3、注意版本号要与springboot版本对应
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
<version>2.2.5.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
三、 Nacos
四、Feign
五、Gateway网关
六、Sentinel服务容错
七、seata分布式事务
项目地址
git仓库地址:https://gitee.com/hmb000/spring-cloud-alibaba.git
实例代码在下面几个模块
待补充。。。。。
相关文章
- Spring中Bean的理解以及@Bean的作用
- Spring Boot Spring Cloud 微服务 分布式项目 实现接口幂等性的 4 种方案
- 拜托!面试请不要再问我Spring Cloud底层原理
- 服务治理: Spring Cloud Eureka
- 手把手教你用Spring Cloud和Docker构建微服务
- Spring Cloud Stream 快速入门
- Spring Session Redis
- 使用Ocelot、IdentityServer4、Spring Cloud Eureka搭建微服务网关:Step by Step(二)
- Spring Cloud Config 实现配置中心,看这一篇就够了
- Spring Cloud Alibaba 2.2.6发布:新增Nacos注册快速失败的配置
- Spring Cloud Alibaba基础教程:Sentinel Dashboard同步Apollo存储规则
- Spring Cloud Stream消费失败后的处理策略(四):重新入队(RabbitMQ)
- 《精通Spring MVC 4》——1.7 错误与转码配置
- MyBatis Spring SqlSessionFactoryBean 配置
- 服务对外提供接口以供不同站点之间使用:Spring Cloud Feign使用记录及携带token请求
- Spring Cloud :Gateway 集成 Sentinel (六)
- Spring Cloud Alibaba 微服务组件 Nacos 配置中心(六)
- Spring Cloud Netflix超时时间设置
- spring-session用mysql实现session共享实践
- spring boot 静态资源的映射规则 (2) 替他资源映射
- Spring Cloud各组件