一、介绍
本文示例基于JDK v1.8、spring-boot v2.2.2、spring-cloud vHoxton.SR1实现(miniblog)的入门微服务项目。
项目地址:https://gitee.com/typ1805/miniblog
二、主框架版本
- java.version 1.8
- spring-boot.version:2.2.2.RELEASE
- spring-cloud.version:Hoxton.SR1
三、软件架构
1、基础应用
| 服务 | 服务名称 | 备注 |
|---|---|---|
| 数据库 | mysql | 各应用可建不同的数据库 |
| 缓存 | redis | 各应用单独实例 |
| 消息中间件 | rabbitmq | 共用 |
| 注册中心 | Eureka | 支持集群部署 |
| 配置中心 | Config | 支持集群部署 |
| 服务网关 | Gateway | 支持集群部署 |
| 断路器监控 | Hystrix | 公用 |
| 负载均衡 | Ribbon、Feign | 公用 |
| 实时配置中心 | Bus | 公用 |
| 链路监控 | zipkin | 公用 |
| ORM | mybatis | 公用 |
| 连接池 | druid | 公用 |
| 代码优化 | lombok | 公用 |
| 分页插件 | pagehelper | 公用 |
| 安全认证 | security、jwt | 公用 |
注意:Idea需要安装lombok插件
2、模块介绍
| 服务名称 | 依赖基础组件 | 简介 | 应用地址 |
|---|---|---|---|
| eureka | security | 注册中心 | http://localhost:8761 |
| config | security、git(使用的gitee)、rabbitmq | 配置中心 | http://localhost:8083 |
| gateway | security、redis:、zipkin | WEB网关 | http://localhost:8080 |
| common | -- | 公共应用 | -- |
| article | mysql、zipkin | 文章管理 | http://localhost:8092 |
| user | security、mysql、zipkin、redis | 用户管理 | http://localhost:8091 |
3、数据库初始化 项目根目录下的database文件中有数据库脚本,直接执行脚本即可。

本文详细介绍了一个基于Spring Boot和Spring Cloud的微服务项目架构,包括服务网关、配置中心、注册中心等关键组件的搭建和使用。
1万+

被折叠的 条评论
为什么被折叠?



