其他分享
首页 > 其他分享> > 5.搭建微服务项目

5.搭建微服务项目

作者:互联网

1.对服务进行划分

微服务模块             端口
webshop_coupon       7000
webshop-member       8000
webshop-order        9000
webshop-prodect      10000
webshop-ware         11000

2.组件选择

   用途                组件
服务注册与发现     Spring Cloud Alibaba-Nacos
配置中心          Spring Cloud Alibaba-Nacos
服务网关          Spring Cloud-Gateway
负载均衡          Spring Cloud-Ribbon
服务熔断限流      Spring Cloud Alibaba-Sentinel
服务通信调用      Spring Cloud-Feign
调用链监控        Spring Cloud-Sleuth+Zipkin
分布式事务        Spring Cloud Alibaba-Seata

3.版本选择

<java.version>1.8</java.version>
<spring-boot.version>2.1.8.RELEASE</spring-boot.version>
<spring-cloud.version>Greenwich.SR3</spring-cloud.version>
<spring-cloud-alibaba.version>2.1.0.RELEASE</spring-cloud-alibaba.version>

<!---------------- 分割线 ------------------->
<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.1.8.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>com.alibaba.cloud</groupId>
            <artifactId>spring-cloud-alibaba-dependencies</artifactId>
            <version>2.1.0.RELEASE</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-dependencies</artifactId>
            <version>${spring-cloud.version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

标签:spring,webshop,服务项目,Cloud,Spring,2.1,cloud,搭建
来源: https://www.cnblogs.com/lailix/p/16647393.html