1-Spring Cloud微服务快速搭建-总体服务

修订日期 内容
2021-2-17 初稿

1-Spring Cloud微服务快速搭建-总体服务

服务技术总览

技术与工具 说明
IntelliJ IDEA 2020.1.1 x64 开发工具
maven 项目构建
Spring Cloud 版本:Hoxton.SR10
spring cloud后续的版本以伦敦地铁站名命名,以首写字母顺序升级版本
Spring boot 版本:2.3.8.RELEASE
jdk 版本:11
eureka注册中心 netflix旗下服务组件

构建步骤

序号 构建步骤 链接
1 创建整体项目 本章
2 eureka注册中心 2-Spring Cloud微服务快速搭建-注册中心-eureka
3 feign整合 3-Spring Cloud微服务快速搭建-Feign<OpenFeign>整合
4 熔断降级Hystrix&Sentinel 4-Spring Cloud微服务快速搭建-Hystrix&Sentinel熔断降级(解决熔断雪崩)
5 网关服务【zuul&gateway】 5-Spring Cloud微服务快速搭建-网关-(zull、gateway-路由配置,过滤器,路径重写,限流-未完善)
6 链路追踪【sleuth-zipkin】 6-Spring Cloud微服务快速搭建-分布式链路追踪-sleuth-zipkin

1.创建总体项目

项目名:spring_cloud_demo
maven配置:

	<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.3.8.RELEASE</version>
    </parent>

    <properties>
        <maven.compiler.encoding>UTF-8</maven.compiler.encoding>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
        <maven.compiler.compilerVersion>11</maven.compiler.compilerVersion>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>Hoxton.SR10</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <!-- 引入alibaba相关依赖-->
            <dependency>
                <groupId>com.alibaba.cloud</groupId>
                <artifactId>spring-cloud-alibaba-dependencies</artifactId>
                <version>2.2.5.RELEASE</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>


    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

Guess you like

Origin blog.csdn.net/weixin_48470176/article/details/113834333