CodeAshen's blog CodeAshen's blog
首页
  • Spring Framework

    • 《剖析Spring5核心原理》
    • 《Spring源码轻松学》
  • Spring Boot

    • Spring Boot 2.0深度实践
  • Spring Cloud

    • Spring Cloud
    • Spring Cloud Alibaba
  • RabbitMQ
  • RocketMQ
  • Kafka
  • MySQL8.0详解
  • Redis从入门到高可用
  • Elastic Stack
  • 操作系统
  • 计算机网络
  • 数据结构与算法
  • 云原生
  • Devops
  • 前端
  • 实用工具
  • 友情链接
关于
收藏
  • 分类
  • 标签
  • 归档
  • Reference
GitHub (opens new window)

CodeAshen

后端界的小学生
首页
  • Spring Framework

    • 《剖析Spring5核心原理》
    • 《Spring源码轻松学》
  • Spring Boot

    • Spring Boot 2.0深度实践
  • Spring Cloud

    • Spring Cloud
    • Spring Cloud Alibaba
  • RabbitMQ
  • RocketMQ
  • Kafka
  • MySQL8.0详解
  • Redis从入门到高可用
  • Elastic Stack
  • 操作系统
  • 计算机网络
  • 数据结构与算法
  • 云原生
  • Devops
  • 前端
  • 实用工具
  • 友情链接
关于
收藏
  • 分类
  • 标签
  • 归档
  • Reference
GitHub (opens new window)
  • 剖析Spring5核心原理

  • Spring源码轻松学

  • Spring Boot 2.0深度实践

  • Spring-Cloud

  • Spring-Cloud-Alibaba

    • 第01章-简介
      • 1.1 什么是Spring Cloud
      • 1.2 什么是Spring Cloud Alibaba
      • 1.3 Spring Cloud Alibaba 和 Spring Cloud 的区别
      • 1.4 Spring Boot整合
    • 第02章-Nacos服务发现
    • 第03章-Ribbon负载均衡
    • 第04章-Feign声明式HTTP客户端
    • 第05章-Sentinel集群容错
    • 第06章-RocketMQ消息队列
    • 第07章-Spring Cloud Gateway网关
    • 第08章-认证授权
    • 第09章-Nacos配置管理
    • 第10章-Sletuh调用链
  • Spring
  • Spring-Cloud-Alibaba
CodeAshen
2023-02-10
目录

第01章-简介

# 1.1 什么是Spring Cloud

快速构建分布式系统的工具集

主要功能:

功能 翻译 选择
Distributed/versioned 分布式/版本化的配置管理 Spring Cloud Config、Consul、Nacos、configuration、Zookeeper
Seruice registration and discovery 服务注册与服务发现 Eureka、Consul、Nacos、Zokeeper
Routing 路由 Zuul、Spring Cloud Gateway
Service-to-service calls 端到端的调用 RestTemplate、Feign
Load balancing 负载均衡 Ribbon
Circuit Breakers 断路器 Hystrix、Sentinel、Resilience4J
Global locks 全局锁 Sprng cloud custer(已证移到Spring Integration)
Leadership election and cluster state 选举与集群状态管理 Spring Cloud Cluster(已迁移到Spring Integration)
Distributed messaging 分布式消息 Spring Cloud Stream + Kafka/RabbitMQ/RocketMQ

# 1.2 什么是Spring Cloud Alibaba

阿里巴巴结合自身微服务实践,开源的微服务全家桶,在Spring Cloud项目中孵化,很可能成为Spring Cloud第二代的标准实现。 在业界广泛使用,已有很多成功案例。

  • Spring Cloud的子项目
  • 致力于提供微服务开发的一站式解决方案。
    • 包含微服务开发的必备组件
    • 基于Spring Cloud,符合Spring Cloud标准
    • 阿里的微服务解决方案

主要功能

功能 产品 备注
服务限流降级 Sentinel 开源组件
服务注册与发现 Nacos、ANS 开源组件、商业组件
分布式配置管理 Nacos、ANS 开源组件、商业组件
消息驱动能力 Spring Cloud Stream、RocketMQ 开源组件
分布式事务 Seata 开源组件,不能用于生产(目前0.6.1),1.0.0之后才可用于生产
阿里云对象存储 oss 商业组件
分布式任务调 SchedulerX 商业组件
阿里云短信服务 SMS 商业组件

# 1.3 Spring Cloud Alibaba 和 Spring Cloud 的区别

image-20210126183350408

总体来说,Spring Cloud Alibaba有以下优势:

  • 组件性能更强
  • 良好的可视化界面
  • 搭建简单,学习曲线低
  • 文档丰富并且是中文

# 1.4 Spring Boot整合

<dependencyManagement>
    <!-- 1. 整合Spring Cloud -->
	<dependencies>
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-dependencies</artifactId>
			<version>{spring-cloud-version}</version>
			<type>pom</type>
			<scope>import</scope>
		</dependency>
	</dependencies>
    <!-- 2. 整合Spring Cloud Alibaba -->
    <dependency>
        <groupId>com.alibaba.cloud</groupId>
        <artifactId>spring-cloud-alibaba-dependencies</artifactId>
        <version>2.2.4.RELEASE</version>
        <type>pom</type>
        <scope>import</scope>
    </dependency>
</dependencyManagement>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
编辑 (opens new window)
上次更新: 2023/06/04, 12:34:19
第06章-微服务安全
第02章-Nacos服务发现

← 第06章-微服务安全 第02章-Nacos服务发现→

最近更新
01
第01章-RabbitMQ导学
02-10
02
第02章-入门RabbitMQ核心概念
02-10
03
第03章-RabbitMQ高级特性
02-10
更多文章>
Theme by Vdoing | Copyright © 2020-2023 CodeAshen | MIT License
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式