22
33一个整合了一些常用功能开箱即用的SpringBoot项目,模块划分清晰易懂,可按需自由组合各个模块运行。
44
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 )
56[ ![ License] ( https://img.shields.io/github/license/MartinDai/SpringBoot-Project )] ( LICENSE )
67
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+ ## 涉及的重要框架和组件清单
139
1410- [ Consul] ( https://github.com/hashicorp/consul )
1511- [ Druid] ( https://github.com/alibaba/druid )
4339- [ Xmemcached] ( https://github.com/killme2008/xmemcached )
4440- [ ZooKeeper] ( https://github.com/apache/zookeeper )
4541
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+ ## 打包编译
4749
4850``` shell
4951./mvnw clean install
5052```
5153
52- # 模块介绍
54+ ## 模块介绍
5355
54- ## docker
55- docker目录里面包含了本项目部分模块需要依赖的的组件环境,可通过脚本一键启动,README.md有详细使用介绍
56+ ### springboot-cache
5657
57- ## springboot-cache
5858包含缓存相关的操作案例
5959
6060- Memcached,整合Memcached-Java-Client和xmemcached两种客户端实现基本操作
6161- Redis,使用Redisson客户端,包含常规操作、分布式锁和布隆过滤器使用示例
6262
63- ## springboot-common
63+ ### springboot-common
64+
6465包含一些通用的工具类等
6566
66- ## springboot-common-web
67+ ### springboot-common-web
68+
6769通用web模块,封装服务于HTTP接口通用的一些类,所有需要对外提供HTTP服务的模块都会依赖此模块
6870
69- ## springboot-dao
71+ ### springboot-dao
72+
7073数据访问模块,基于MyBatis封装了包含User和UserLogin两个表的基本操作
7174
7275SQL部分是基于sharding-jdbc分库分表写的,数据库表初始化文件为spring_project_1.sql和spring_project_2.sql
7376
7477部分需要操作数据库的模块会依赖此模块
7578
76- ## springboot-db-controller
79+ ### springboot-db-controller
80+
7781依赖于springboot-dao,对外提供访问数据库相关操作的接口,主要是为了方便把dao做成可选的灵活组合,一般整合在web模块的
7882
7983部分需要操作数据库的模块会依赖此模块
8084
81- ## springboot-dubbo-api
85+ ### springboot-dubbo-api
86+
8287dubbo服务的api模块,dubbo-provider和dubbo-consumer会依赖此模块
8388
84- ## springboot-dubbo-consumer
89+ ### springboot-dubbo-consumer
90+
8591dubbo服务消费者,内容包含
8692
8793- 简单的dubbo服务调用示例
8894- 整合Hystrix熔断
8995- 整合Sentinel限流
9096- 自定义Filter统计服务调用耗时日志
9197
92- ## springboot-dubbo-provider
98+ ### springboot-dubbo-provider
99+
93100dubbo服务提供者,包含基于dubbo-api模块实现的dubbo服务,提供了两种协议(dubbo和rest)
94101
95102可单独启动,入口为DubboApplication
@@ -103,52 +110,65 @@ curl --location --request POST 'http://127.0.0.1:8080/dubbo-rest/getDubboInfo' \
103110}'
104111```
105112
106- ## springboot-elasticsearch
113+ ### springboot-elasticsearch
114+
107115包含elasticsearch服务基本crud操作
108116
109- ## springboot-feign-consumer
117+ ### springboot-feign-consumer
118+
110119feign服务消费者,包含简单的feign服务调用示例,使用consul做服务发现
111120
112- ## springboot-feign-provider
121+ ### springboot-feign-provider
122+
113123feign服务提供者,包含简单的基于feign实现的服务,使用consul做服务注册,可单独启动,入口为FeignApplication
114124
115- ## springboot-leaf
125+ ### springboot-leaf
126+
116127整合美团开源的分布式ID生成服务leaf,包含记录HTTP接口耗时日志切面,数据库表初始化文件为leaf.sql
117128
118- ## springboot-opentelemetry
129+ ### springboot-opentelemetry
130+
119131集成OpenTelemetry的SDK采集上报可观测相关数据
120132
121133- 支持Metrics推送至VictoriaMetrics(需在application.yml配置victoriaMetrics.url)
122134
123- ## springboot-netty
135+ ### springboot-netty
136+
124137包含基于netty+websocket实现的简易聊天室功能,入口页面为chat-netty.html
125138
126- ## springboot-rocketmq-consumer
139+ ### springboot-rocketmq-consumer
140+
127141包含RocketMQ的消费者使用示例,消息来自于rocketmq-producer模块
128142
129143- 普通消息并发消费示例
130144- 事务消息使用示例(可实现最终一致性分布式事务)
131145- 顺序消息消费示例
132146
133- ## springboot-rocketmq-producer
147+ ### springboot-rocketmq-producer
148+
134149RocketMQ的消息生产者模块,内容包含
135150
136151- 使用tomcat提供的ServerEndpoint注解基于websocket实现的简单聊天室功能,聊天消息会发送RocketMQ普通消息,入口页面为chat-websocket.html
137152- 提供了简单的用户操作HTTP接口,其中删除用户会发送RocketMQ事务消息
138153
139- ## springboot-seata
154+ ### springboot-seata
155+
140156seata示例的TM服务,可单独启动,docker目录下有seata-server的容器配置
141157
142- ## springboot-seata-common
158+ ### springboot-seata-common
159+
143160seata功能的通用模块
144161
145- ## springboot-seata-order
162+ ### springboot-seata-order
163+
146164seata功能的订单RM服务,可单独启动
147165
148- ## springboot-seata-storage
166+ ### springboot-seata-storage
167+
149168seata功能的商品库存RM服务,可单独启动
150169
151- ## springboot-web
170+ ### springboot-web
171+
152172Web模块,默认整合依赖了其他所有不支持单独启动的功能模块,可根据实际需要进行增删调整,启动入口为WebApplication,里面包含了所有其他模块需要的注解配置
153173
154174本模块内容包括
@@ -159,9 +179,10 @@ Web模块,默认整合依赖了其他所有不支持单独启动的功能模
159179- 简单的Excel上传下载功能
160180- 堆和直接内存使用情况监控接口
161181
162- ## springboot-zookeeper
182+ ### springboot-zookeeper
183+
163184包含基于zookeeper实现的分布式锁示例
164185
165- # 感谢赞助
186+ ## 感谢赞助
166187
167188[ <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