GuLi Mall-Introduction to SpringCloud Alibaba and the corresponding relationship with spring Boot version

1. Introduction to Spring Cloud Alibaba

1 Introduction

Spring Cloud Alibaba is committed to providing a one-stop solution for microservice development. This project includes the development of distributed application microservices

The necessary components of the service, so that developers can easily use these components to develop distributed application services through the Spring Cloud programming model

service.

Relying on Spring Cloud Alibaba, you only need to add some annotations and a small amount of configuration to connect Spring Cloud applications

Enter Ali's micro-service solution, and quickly build a distributed application system through Ali middleware.

https://github.com/alibaba/spring-cloud-alibaba


2), why use

Eureka 2.x stop maintenance

Several major pain points of Spring Cloud

Some components of SpringCloud stop maintenance and updates, which brings inconvenience to development;

Part of the SpringCloud environment is complex to build, and there is no perfect visual interface. We need a lot of secondary development and customization

SpringCloud configuration is complex, difficult to get started, and some configuration differences are difficult to distinguish and apply reasonably

Advantages of SpringCloud Alibaba: The components used by Alibaba have been tested, with powerful performance and reasonable design, and are now open source

Everyone uses it. A complete set of products with a complete visual interface brings great convenience to development, operation and maintenance. It is easy to build and has a low learning curve.


Combining SpringCloud Alibaba with our final technical solution:

结合 SpringCloud Alibaba 我们最终的技术搭配方案: 
SpringCloud Alibaba - Nacos:注册中心(服务发现/注册) 
SpringCloud Alibaba - Nacos:配置中心(动态配置管理) 
SpringCloud - Ribbon:负载均衡
SpringCloud - Feign:声明式 HTTP 客户端(调用远程服务) 
SpringCloud Alibaba - Sentinel:服务容错(限流、降级、熔断) 
SpringCloud - Gateway:API 网关(webflux 编程模式) 
SpringCloud - Sleuth:调用链监控
SpringCloud Alibaba - Seata:原 Fescar,即分布式事务解决方案

3), version selection

Since Spring Boot 1 and Spring Boot 2 have a lot of changes in the interface and annotations of the Actuator module, and spring-

The cloud-commons upgrade from version 1.xx to version 2.0.0 also has a big change, so we adopt the SpringBoot version

Versions consistent with this number:

The 1.5.x release is for Spring Boot 1.5.x

The 2.0.x version is for Spring Boot 2.0.x 

The 2.1.x version is for Spring Boot 2.1.x


Release notes:

Release Notes · alibaba/spring-cloud-alibaba Wiki · GitHub

Since the version of my spring boot was changed to 2.6.6

So: 2021.0.4.0* 

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>com.alibaba.cloud</groupId>
            <artifactId>spring-cloud-alibaba-dependencies</artifactId>
            <version>2021.0.4.0*</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

4), dependencies in the project

在 common 项目中引入如下。进行统一管理 
<dependencyManagement>
    <dependencies> 
        <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>
    </dependencies> 
</dependencyManagement>

Introduce:

The result is not good

Just change it to 2021.0.1.0:

Guess you like

Origin blog.csdn.net/ZHOU_VIP/article/details/128908706