Skip to content

Spring Cloud 生态使用指南

Spring Cloud 是构建微服务分布式系统的常用工具集。

文档目录

组件文档说明
Nacosnacos/服务注册发现(含 Dubbo 集成) + 配置中心
RocketMQrocketmq/分布式消息中间件
OpenFeignopenfeign/声明式 HTTP 客户端(外部 API 调用)

MySQL / MyBatis / MyBatis-Plus 已归类到 数据库与缓存 栏目下。

微服务架构关系

text
                  ┌──────────────┐
                  │    Nacos     │ ← 注册中心 / 配置中心
                  └──────┬───────┘
          ┌───────────────┼───────────────┐
          ▼               ▼               ▼
   ┌──────────┐   ┌──────────┐   ┌──────────┐
   │ Service A│──▶│ Service B│   │ Service C│
   └────┬─────┘   └──────────┘   └──────────┘
        │ Dubbo / OpenFeign 远程调用

   ┌──────────┐
   │ RocketMQ │
   │ 消息队列  │
   └──────────┘

版本对应

Spring CloudSpring BootSpring Cloud Alibaba
2021.0.x2.7.x2021.0.6.0
2022.0.x3.0.x2022.0.x
2023.0.x3.2.x2023.0.x
2024.0.x3.4.x2024.0.x

统一依赖管理

本文档基于 Spring Boot 2.7.x 版本。

xml
<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-dependencies</artifactId>
            <version>2021.0.9</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
        <dependency>
            <groupId>com.alibaba.cloud</groupId>
            <artifactId>spring-cloud-alibaba-dependencies</artifactId>
            <version>2021.0.6.0</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>
最近更新