SpringCloud combat project full set of learning tutorials in serial
PassJava learning tutorial
Introduction
- The PassJava-Learning project is a learning tutorial for the PassJava project. Explain the main points of architecture, business and technology.
- PassJava is an
面试刷题
open source system for Java . You can use small programs to view common interview questions in a fraction of the time to consolidate the foundation of Java. - PassJava project can teach you how to build SpringBoot project, Spring Cloud project
- Use popular technologies such as SpringBoot, MyBatis, Redis, MySql, MongoDB, RabbitMQ, Elasticsearch, and adopt Docker containerized deployment.
Better reading experience
- Document address: http://www.jayh.club
- Alternate address: https://jackson0714.github.io/PassJava-Learning
Document serialization directory
- Create a small program that brushes Java knowledge
- Create a small program that brushes Java knowledge (2)
- 01. Understand distributed basic concepts in five minutes
- 02. Quickly build a Linux environment-essential for operation and maintenance
- 03. Configure the virtual machine network
- 04. Install Docker
- 05.Docker install mysql
- 06.Docker install redis
- 07. Local development environment configuration
- 08. Configure Git
- 09. Initialize the project and add microservices
- 10.PassJava-micro service division diagram
- 11. Initialize the database and tables
- 12. Build management background
- 13. Automatically generate front-end and back-end codes
- 14. Integrate MyBatis-Plus to achieve CRUD
- 15. Generate CRUD code for all microservices
- 16. Introduction to Spring Cloud Alibaba components
Introduction to SpringCloud Alibaba components
1. Overview of Spring Cloud Alibaba
Spring Cloud Alibaba is committed to providing a one-stop solution for microservice development. This project contains the necessary components for the development of distributed application microservices, so that developers can easily use these components to develop distributed application services through the Spring Cloud programming model.
Relying on Spring Cloud Alibaba, you only need to add some annotations and a small amount of configuration to connect Spring Cloud applications to Alibaba microservices solutions, and quickly build distributed application systems through Alibaba middleware.
Github:https://github.com/alibaba/spring-cloud-alibaba
Several major pain points of Spring Cloud
- Some components are stopped for maintenance and update, and problems are not easy to solve
- Some environments are more complicated to build, and there is no very friendly visual interface
- Configuration is relatively complex and requires high learning costs
Advantages of Spring Cloud Alibaba
- Ali has passed the test of time
- Reasonable design
- Has a good visual interface to facilitate operation and maintenance monitoring and troubleshooting
- Simple environment construction and configuration, low learning cost
PassJava project with SpringCloud Alibaba technology matching solution
description | Spring Cloud | Spring Cloud Alibaba | Combination selection |
---|---|---|---|
Service discovery component | Eureka (stop maintenance) service discovery component | Nacos Registration Center | Spring Cloud Alibaba - Nacos |
Configuration Center Components | Spring Cloud Config configuration center | Nacos Configuration Center | Spring Cloud Alibaba - Nacos |
Break protection components | Hystrix circuit protection | Sentinel service fault tolerance | Spring Cloud Alibaba - Sentinel |
Link tracking component | Sleuth call chain monitoring | / | Spring Cloud - Sleuth |
Load balancing components | Ribbon | / | Spring Cloud - Ribbon |
Remote call component | OpenFeign (HTTP+JSON) | Dubbo (RPC framework) | Spring Cloud - OpenFeign |
Distributed transaction | / | Seata distributed transactions | Spring Cloud Alibaba - Seata |
API Gateway | Gateway | / | Spring Cloud - Gateway |
Final technical selection:
Spring Cloud Alibaba - Nacos 实现注册中心
Spring Cloud Alibaba - Nacos 实现配置中心
Spring Cloud Alibaba - Sentinel 实现服务容错
Spring Cloud Alibaba - Seata 实现分布式事务
Spring Cloud - Ribbon 实现负载均衡
Spring Cloud - Feign 实现远程调用
Spring Cloud - Gateway API网关
Spring Cloud - Sleuth 实现调用链监控
2. Spring Cloud Alibaba version
The version number format of the project is in the form of xxx, where the numeric type of x is a number, which starts from 0 and is not limited to the range of 0 ~ 9. When the project is in the incubator stage, the first version number is fixed at 0, that is, the version number is in the format of 0.xx.
Because the interfaces and annotations of Spring Boot 1 and Spring Boot 2 in the Actuator module have changed a lot, and the upgrade of spring-cloud-commons from version 1.xx to version 2.0.0 also has major changes, so Ali adopts the version with SpringBoot Consistent version:
- The 1.5.x version applies to Spring Boot 1.5.x
- Version 2.0.x applies to Spring Boot 2.0.x
- The 2.1.x version applies to Spring Boot 2.1.x
- Version 2.2.x applies to Spring Boot 2.2.x
Spring Cloud Alibaba version and Spring Cloud and Spring Boot version compatibility list
Spring Cloud version | Spring Cloud Alibaba version | Spring Boot version |
---|---|---|
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 |
We use Spring Cloud Hoxton.SR3
, Spring Cloud Alibaba 2.2.0.RELEASE
,Spring Boot 2.2.6 RELEASE
PassJava-Common pom.xml file introduces Spring Cloud Alibaba dependency
<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>
Code address
https://github.com/Jackson0714/PassJava-Platform