2
2
3
3
一个整合了一些常用功能开箱即用的SpringBoot项目,模块划分清晰易懂,可按需自由组合各个模块运行。
4
4
5
+ [ ![ Release] ( https://img.shields.io/github/v/release/martindai/SpringBoot-Project?color=369eff&labelColor=black&logo=github&style=flat-square )] ( https://github.com/martindai/SpringBoot-Project/releases )
5
6
[ ![ License] ( https://img.shields.io/github/license/MartinDai/SpringBoot-Project )] ( LICENSE )
6
7
7
-
8
- 注意:本项目使用了lombok来简化Getter/Setter,所以需要安装lombok插件才能保证编译不报错
9
-
10
- 本项目整合了Swagger,启动web模块后可以通过[ http://127.0.0.1:2019/doc.html ] ( http://127.0.0.1:2019/doc.html ) 查看
11
-
12
- # 涉及的重要框架和组件清单
8
+ ## 涉及的重要框架和组件清单
13
9
14
10
- [ Consul] ( https://github.com/hashicorp/consul )
15
11
- [ Druid] ( https://github.com/alibaba/druid )
43
39
- [ Xmemcached] ( https://github.com/killme2008/xmemcached )
44
40
- [ ZooKeeper] ( https://github.com/apache/zookeeper )
45
41
46
- # 打包编译
42
+ ## 提示
43
+
44
+ - 项目使用了lombok来简化Getter/Setter,所以需要安装lombok插件才能保证编译不报错
45
+ - 项目整合了Swagger,启动web模块后可以通过[ http://127.0.0.1:2019/doc.html ] ( http://127.0.0.1:2019/doc.html ) 查看
46
+ - 项目中用到的第三方组件,可通过项目[ docker-compose-environment] ( https://github.com/MartinDai/docker-compose-environment ) 找到相关配置文件使用` docker-compose ` 命令一键启动
47
+
48
+ ## 打包编译
47
49
48
50
``` shell
49
51
./mvnw clean install
50
52
```
51
53
52
- # 模块介绍
54
+ ## 模块介绍
53
55
54
- ## docker
55
- docker目录里面包含了本项目部分模块需要依赖的的组件环境,可通过脚本一键启动,README.md有详细使用介绍
56
+ ### springboot-cache
56
57
57
- ## springboot-cache
58
58
包含缓存相关的操作案例
59
59
60
60
- Memcached,整合Memcached-Java-Client和xmemcached两种客户端实现基本操作
61
61
- Redis,使用Redisson客户端,包含常规操作、分布式锁和布隆过滤器使用示例
62
62
63
- ## springboot-common
63
+ ### springboot-common
64
+
64
65
包含一些通用的工具类等
65
66
66
- ## springboot-common-web
67
+ ### springboot-common-web
68
+
67
69
通用web模块,封装服务于HTTP接口通用的一些类,所有需要对外提供HTTP服务的模块都会依赖此模块
68
70
69
- ## springboot-dao
71
+ ### springboot-dao
72
+
70
73
数据访问模块,基于MyBatis封装了包含User和UserLogin两个表的基本操作
71
74
72
75
SQL部分是基于sharding-jdbc分库分表写的,数据库表初始化文件为spring_project_1.sql和spring_project_2.sql
73
76
74
77
部分需要操作数据库的模块会依赖此模块
75
78
76
- ## springboot-db-controller
79
+ ### springboot-db-controller
80
+
77
81
依赖于springboot-dao,对外提供访问数据库相关操作的接口,主要是为了方便把dao做成可选的灵活组合,一般整合在web模块的
78
82
79
83
部分需要操作数据库的模块会依赖此模块
80
84
81
- ## springboot-dubbo-api
85
+ ### springboot-dubbo-api
86
+
82
87
dubbo服务的api模块,dubbo-provider和dubbo-consumer会依赖此模块
83
88
84
- ## springboot-dubbo-consumer
89
+ ### springboot-dubbo-consumer
90
+
85
91
dubbo服务消费者,内容包含
86
92
87
93
- 简单的dubbo服务调用示例
88
94
- 整合Hystrix熔断
89
95
- 整合Sentinel限流
90
96
- 自定义Filter统计服务调用耗时日志
91
97
92
- ## springboot-dubbo-provider
98
+ ### springboot-dubbo-provider
99
+
93
100
dubbo服务提供者,包含基于dubbo-api模块实现的dubbo服务,提供了两种协议(dubbo和rest)
94
101
95
102
可单独启动,入口为DubboApplication
@@ -103,52 +110,65 @@ curl --location --request POST 'http://127.0.0.1:8080/dubbo-rest/getDubboInfo' \
103
110
}'
104
111
```
105
112
106
- ## springboot-elasticsearch
113
+ ### springboot-elasticsearch
114
+
107
115
包含elasticsearch服务基本crud操作
108
116
109
- ## springboot-feign-consumer
117
+ ### springboot-feign-consumer
118
+
110
119
feign服务消费者,包含简单的feign服务调用示例,使用consul做服务发现
111
120
112
- ## springboot-feign-provider
121
+ ### springboot-feign-provider
122
+
113
123
feign服务提供者,包含简单的基于feign实现的服务,使用consul做服务注册,可单独启动,入口为FeignApplication
114
124
115
- ## springboot-leaf
125
+ ### springboot-leaf
126
+
116
127
整合美团开源的分布式ID生成服务leaf,包含记录HTTP接口耗时日志切面,数据库表初始化文件为leaf.sql
117
128
118
- ## springboot-opentelemetry
129
+ ### springboot-opentelemetry
130
+
119
131
集成OpenTelemetry的SDK采集上报可观测相关数据
120
132
121
133
- 支持Metrics推送至VictoriaMetrics(需在application.yml配置victoriaMetrics.url)
122
134
123
- ## springboot-netty
135
+ ### springboot-netty
136
+
124
137
包含基于netty+websocket实现的简易聊天室功能,入口页面为chat-netty.html
125
138
126
- ## springboot-rocketmq-consumer
139
+ ### springboot-rocketmq-consumer
140
+
127
141
包含RocketMQ的消费者使用示例,消息来自于rocketmq-producer模块
128
142
129
143
- 普通消息并发消费示例
130
144
- 事务消息使用示例(可实现最终一致性分布式事务)
131
145
- 顺序消息消费示例
132
146
133
- ## springboot-rocketmq-producer
147
+ ### springboot-rocketmq-producer
148
+
134
149
RocketMQ的消息生产者模块,内容包含
135
150
136
151
- 使用tomcat提供的ServerEndpoint注解基于websocket实现的简单聊天室功能,聊天消息会发送RocketMQ普通消息,入口页面为chat-websocket.html
137
152
- 提供了简单的用户操作HTTP接口,其中删除用户会发送RocketMQ事务消息
138
153
139
- ## springboot-seata
154
+ ### springboot-seata
155
+
140
156
seata示例的TM服务,可单独启动,docker目录下有seata-server的容器配置
141
157
142
- ## springboot-seata-common
158
+ ### springboot-seata-common
159
+
143
160
seata功能的通用模块
144
161
145
- ## springboot-seata-order
162
+ ### springboot-seata-order
163
+
146
164
seata功能的订单RM服务,可单独启动
147
165
148
- ## springboot-seata-storage
166
+ ### springboot-seata-storage
167
+
149
168
seata功能的商品库存RM服务,可单独启动
150
169
151
- ## springboot-web
170
+ ### springboot-web
171
+
152
172
Web模块,默认整合依赖了其他所有不支持单独启动的功能模块,可根据实际需要进行增删调整,启动入口为WebApplication,里面包含了所有其他模块需要的注解配置
153
173
154
174
本模块内容包括
@@ -159,9 +179,10 @@ Web模块,默认整合依赖了其他所有不支持单独启动的功能模
159
179
- 简单的Excel上传下载功能
160
180
- 堆和直接内存使用情况监控接口
161
181
162
- ## springboot-zookeeper
182
+ ### springboot-zookeeper
183
+
163
184
包含基于zookeeper实现的分布式锁示例
164
185
165
- # 感谢赞助
186
+ ## 感谢赞助
166
187
167
188
[ <img src =" https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.svg " width =" 140 " height =" 140 " alt =" jetbrains " />] ( https://www.jetbrains.com/community/opensource/#support )
0 commit comments