Spring Cloud Alibab简介及初始环境搭建

Spring Cloud Alibaba简介

Spring Cloud Alibaba provides a one-stop solution for distributed application development. It contains all the components required to develop distributed applications, making it easy for you to develop your applications using Spring Cloud. – 摘自官网

译文:Spring Cloud Alibaba是阿里巴巴为分布式应用开发提供一站式解决方案。它包含了开发分布式应用程序所需的所有组件,使您可以轻松地使用Spring Cloud开发应用程序。

Spring Cloud Alibaba组件

  • Flow control and service degradation:flow control, circuit breaking and system adaptive protection with Alibaba Sentinel
  • Service registration and discovery:instances can be registered with Alibaba Nacos and clients can discover the instances using Spring-managed beans. Supports Ribbon, the client side load-balancer via Spring Cloud Netflix
  • Distributed Configuration:using Alibaba Nacos as a data store
  • Event-driven:building highly scalable event-driven microservices connected with Spring Cloud Stream RocketMQ Binder
  • Message Bus: link nodes of a distributed system with Spring Cloud Bus RocketMQ
  • Distributed Transaction:support for distributed transaction solution with high performance and ease of use with Seata
  • Dubbo RPC:extend the communication protocols of Spring Cloud service-to-service calls by Apache Dubbo RPC
Spring Cloud组件组件的作用及描述Spring Cloud Alibaba组件
Eureka | consul服务注册与发现Nacos
RestTemplate OpenFeign服务间通信Dubbo RPC
Hystrix服务降级、熔断Sentinel
Bus事件驱动RocketMQ
消息总线(异步处理)Message Bus
分布式事务Seata
Config统一配置中心Nacos

实际开发中,我们是SpringCloud与SpringCloudAlibaba混合使用的。

  • 服务注册中心 ---------- Nacos
  • 服务间通信与负载均衡 ---------- HttpRest(a:RestTemplate+Ribbon b: OpenFeign)
  • 服务流控与服务降级 ---------- Sentinel
  • 服务网关组件 ---------- Gateway
  • 统一配置中心 ---------- Nacos

初始环境搭建

1.新建Module

在这里插入图片描述

2.pom.xml

这里我们使用的SpringBoot版本是2.2.5.RELEASE、SpringCloud版本是Hoxton.SR6、SpringCloud alibaba的版本是最新的2.2.1.RELEASE

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.christy</groupId>
    <artifactId>springcloud_alibaba_parent</artifactId>
    <version>1.0-SNAPSHOT</version>

    <!--继承springboot父项目-->
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.2.5.RELEASE</version>
    </parent>

    <properties>
        <maven.compiler.source>8</maven.compiler.source>
        <maven.compiler.target>8</maven.compiler.target>

        <spring.cloud.version>Hoxton.SR6</spring.cloud.version>
        <spring.cloud.alibaba.version>2.2.1.RELEASE</spring.cloud.alibaba.version>
    </properties>

    <!--维护依赖-->
    <dependencyManagement>
        <dependencies>
            <!--维护springcloud-->
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>${spring.cloud.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <!--维护springcloud alibaba-->
            <dependency>
                <groupId>com.alibaba.cloud</groupId>
                <artifactId>spring-cloud-alibaba-dependencies</artifactId>
                <version>${spring.cloud.alibaba.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>

    </dependencyManagement>
</project>

springcloud_alibaba_parent作为全局的父项目我们就搭建完毕了,下一接我们从服务注册与发现(Nacos)学起。ヾ(◍°∇°◍)ノ゙

本系列专题源码已经上传至gitee:https://gitee.com/tide001/springcloud_parent,欢迎下载交流

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

潮汐先生

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值