一、springcloud 介绍

1、什么是 springcloud

SpringCloud 是微服务一站式服务解决方案,微服务全家桶。它是微服务开发的主流技术栈。它采用了名称,而非数字版本号。

SpringCloud 和 springCloud Alibaba 目前是最主流的微服务框架组合。

2、SpringCloud 版本选择

选用 springboot 和 springCloud 版本有约束,不按照它的约束会有冲突。

Cloud Release Train Boot Version
Hoxton 2.2.x, 2.3.x (Starting with SR5)
Greenwich 2.1.x
Finchley 2.0.x
Finchley 1.5.x
Dalston 1.5.x

查看版本对应关系:https://start.spring.io/actuator/info

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
{
"git": {
"branch": "986e72b4a38a4dd320be9bf55b47e54f7ccc0095",
"commit": {
"id": "986e72b",
"time": "2023-07-12T18:06:05Z"
}
},
"build": {
"version": "0.0.1-SNAPSHOT",
"artifact": "start-site",
"versions": {
"spring-boot": "3.1.1",
"initializr": "0.20.1-SNAPSHOT"
},
"name": "start.spring.io website",
"time": "2023-07-12T18:08:16.738Z",
"group": "io.spring.start"
},
"bom-ranges": {
"codecentric-spring-boot-admin": {
"2.6.8": "Spring Boot >=2.6.0 and <2.7.0-M1",
"2.7.4": "Spring Boot >=2.7.0-M1 and <3.0.0-M1",
"3.0.4": "Spring Boot >=3.0.0-M1 and <3.1.0-M1",
"3.1.1": "Spring Boot >=3.1.0-M1 and <3.2.0-M1"
},
"hilla": {
"2.1.1": "Spring Boot >=3.1.0-M1 and <3.2.0-M1"
},
"solace-spring-boot": {
"1.2.2": "Spring Boot >=2.6.0 and <3.0.0-M1",
"2.0.0": "Spring Boot >=3.0.0-M1"
},
"solace-spring-cloud": {
"2.3.2": "Spring Boot >=2.6.0 and <3.0.0-M1",
"3.0.0": "Spring Boot >=3.0.0-M1"
},
"spring-cloud": {
"2021.0.8": "Spring Boot >=2.6.0 and <3.0.0",
"2022.0.3": "Spring Boot >=3.0.0 and <3.2.0-M1"
},
"spring-cloud-azure": {
"4.9.0": "Spring Boot >=2.6.0 and <3.0.0-M1",
"5.3.0": "Spring Boot >=3.0.0-M1 and <3.2.0-M1"
},
"spring-cloud-gcp": {
"3.5.4": "Spring Boot >=2.6.0 and <3.0.0-M1",
"4.5.1": "Spring Boot >=3.0.0-M1 and <3.2.0-M1"
},
"spring-cloud-services": {
"3.4.0": "Spring Boot >=2.6.0 and <2.7.0-M1",
"3.5.0": "Spring Boot >=2.7.0-M1 and <3.0.0-M1",
"4.0.0": "Spring Boot >=3.0.0 and <3.1.0-M1"
},
"spring-modulith": {
"1.0.0-M1": "Spring Boot >=3.1.0 and <3.2.0-M1"
},
"spring-shell": {
"2.1.11": "Spring Boot >=2.7.0 and <3.0.0-M1",
"3.0.6": "Spring Boot >=3.0.0 and <3.1.0-M1",
"3.1.2": "Spring Boot >=3.1.0 and <3.2.0-M1"
},
"vaadin": {
"23.2.15": "Spring Boot >=2.6.0 and <2.7.0-M1",
"23.3.16": "Spring Boot >=2.7.0-M1 and <3.0.0-M1",
"24.0.9": "Spring Boot >=3.0.0-M1 and <3.1.0-M1",
"24.1.2": "Spring Boot >=3.1.0-M1 and <3.2.0-M1"
},
"wavefront": {
"2.2.2": "Spring Boot >=2.6.0 and <2.7.0-M1",
"2.3.4": "Spring Boot >=2.7.0-M1 and <3.0.0-M1",
"3.0.1": "Spring Boot >=3.0.0-M1 and <3.1.0-M1"
}
},
"dependency-ranges": {
"okta": {
"2.1.6": "Spring Boot >=2.6.0 and <3.0.0-M1",
"3.0.4": "Spring Boot >=3.0.0-M1 and <3.2.0-M1"
},
"mybatis": {
"2.2.2": "Spring Boot >=2.6.0 and <2.7.0-M1",
"2.3.1": "Spring Boot >=2.7.0-M1 and <3.0.0-M1",
"3.0.2": "Spring Boot >=3.0.0-M1"
},
"pulsar": {
"0.2.0": "Spring Boot >=3.0.0 and <3.2.0-M1"
},
"pulsar-reactive": {
"0.2.0": "Spring Boot >=3.0.0 and <3.2.0-M1"
},
"camel": {
"3.17.0": "Spring Boot >=2.6.0 and <2.7.0-M1",
"3.20.6": "Spring Boot >=2.7.0.M1 and <3.0.0-M1",
"4.0.0-RC1": "Spring Boot >=3.0.0-M1 and <3.2.0-M1"
},
"picocli": {
"4.7.0": "Spring Boot >=2.6.0 and <3.1.0-M1"
},
"open-service-broker": {
"3.5.0": "Spring Boot >=2.6.0 and <2.7.0-M1"
}
}
}

Ps:cloud 版本决定了 boot 版本

3、微服务停更说明

以前:

现在:

1、Eureka 停用,可以使用 zk 作为服务注册中心

2、服务调用,Ribbon 准备停更,代替为 LoadBalance

3、Feign 改为 OpenFeign

4、Hystrix 停更,改为 resilence4j,或者阿里巴巴的 sentienl

5、Zuul 改为 gateway

6、服务配置 Config 改为 Nacos

7、服务总线 Bus 改为 Nacos

4、要学点

参考资料:springcloud springcloud 中文文档 springboot v2.2.2

5、课程所用软件版本

cloud Hoxton.SR1
boot 2.2.2.RELEASE
cloud alibaba 2.1.0.RELEASE
java java8
maven 3.5 及以上
mysql 5.7 及以上

相关链接:微服务架构编码构建