spring cloud - 初识

本文介绍SpringCloud作为微服务实现方式之一的基础概念,包括其如何通过简化开发来构建微服务架构。文中详细列举了SpringCloud的常见模块,如Eureka注册中心、Ribbon负载均衡、Zuul网关、Feign服务调用和Hystrix熔断器,并解释了这些组件在微服务架构中的作用。此外,还提供了SpringCloud父项目的pom依赖配置示例。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

初识Spring Cloud

1.什么是Spring Cloud

spring Cloud是微服务的实现方式之一.
微服务是一种架构风格, 即 将单体应用划分为小型的服务单元.
spring Cloud是一系列框架的集合, 利用spring Boot简化了开发

2.spring Cloud 常见模块

  • Eureka : 注册中心, 用于注册所有服务 (项目/应用)
  • Ribbon : 负载均衡 , 用于搭建集群的.
  • zuul 网关 : 确定统一入口, 方便进行管理
  • Feign : 服务与服务之间调用. 类似httpclient
  • Hystrix : 熔断器, 与正主失去联系, 使用备胎.

在这里插入图片描述

3.spring Cloud 父项目pom依赖

 <!-- 1 确定spring boot的版本-->
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.4.RELEASE</version>
    </parent>
    <!--2  确定版本-->
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.version>1.8</java.version>
        <spring-cloud-release.version>Greenwich.RELEASE</spring-cloud-release.version>
    </properties>

    <!-- 3 锁定sprig cloud版本-->
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>${spring-cloud-release.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <!-- 4 确定spring cloud私有仓库-->
    <repositories>
        <repository>
            <id>spring-milestones</id>
            <name>Spring Milestones</name>
            <url>https://repo.spring.io/milestone</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值