2 Star 68 Fork 43

huanzi-qch / springCloud

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

官网

https://huanzi-qch.gitee.io/spring-cloud

简介

SpringCloud系列Demo代码

SpringCloud的Demo代码包括了一下分布式的基本组件,具体请看博客、代码
父项目是一个maven项目,继承spring-boot-starter-parent,引入spring-cloud依赖管理,同时引入了部分公用依赖

    <!--  父类继承spring-boot-starter-parent  -->
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.0.RELEASE</version>
        <relativePath/>
    </parent>
    
    <!-- 引入spring-cloud依赖管理 -->
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>Greenwich.RC1</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <!-- 在父类引入一下通用的依赖 -->
    <dependencies>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-dependencies</artifactId>
            <version>Greenwich.RC1</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>

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

        <!-- springboot web(MVC)-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

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

        <!-- actuator -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>

        <!--lombok插件 -->
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
        </dependency>

        <!--热部署工具dev-tools-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <optional>true</optional>
            <scope>runtime</scope>
        </dependency>
    </dependencies>

    <!-- 仓库地址 -->
    <repositories>
        <repository>
            <id>spring-milestones</id>
            <name>Spring Milestones</name>
            <url>https://repo.spring.io/milestone</url>
        </repository>
    </repositories>

每个子项目都是一个独立的SpringBoot项目,子项目直接继承父类

    <!--继承父类-->
    <parent>
        <groupId>cn.huanzi.qch</groupId>
        <artifactId>parent</artifactId>
        <version>1.0.0</version>
    </parent>

每个子项目都是SpringCloud的一个知识点或者说技能点,具体见名思意!具体介绍都有对应的博客,详情请看下方的“前往博客查看详情”
SpringCloud代码跟之前写博客时有所改动,现在的项目命名更加规范,比较利于理解

改动后测试例子:
PS:由于图片是引入我博客里面的图片,有时会出现显示不出来的问题,可以直接前往博客-->点击目录:SpringCloud系列,即可查看效果图

eureka注册

sso单点登录

令牌桶限流

feign调用

ribbon负载均衡

txlcn分布式事务

事务回滚

事务提交

仓库地址

国外:https://github.com/huanzi-qch/springCloud
国内:https://gitee.com/huanzi-qch/springCloud

前往博客查看详情

具体介绍请看我的博客《SpringCloud系列》

项目 博客
config-server SpringCloud系列——Config 配置中心
SpringCloud系列——Bus 消息总线
eureka-server SpringCloud系列——Eureka 服务注册与发现
sso-server SpringCloud系列——SSO 单点登录
txlcn-tm SpringCloud系列——TX-LCN分布式事务管理
zuul-server SpringCloud系列——Zuul 动态路由
zipkin-server SpringCloud系列——分布式链路追踪
server-a
server-b1/b2
server-c
SpringCloud系列——Feign 服务调用
server-b1/b2 SpringCloud系列——Ribbon 负载均衡

AD广告位 (长期招租,如有需要请私信)

【基塔后台】免费后台管理系统,低代码快速搭建管理后台

【阿里云】阿里云最全的优惠活动聚集地!
【腾讯云】腾讯云当前最新优惠活动专区!

QQ群

有事请加群,有问题进群大家一起交流!

捐献

相应的资金支持能更好的持续项目的维护和开发,如果喜欢这个项目,请随意打赏!

支付宝 微信

学习资料

Spring全家桶的GitHub:https://github.com/spring-projects
SpringCloud官方文档:https://spring.io/projects/spring-cloud
SpringCloud官方GitHub:https://github.com/spring-cloud

这些资料有丰富的文档介绍、代码示例

MIT License Copyright (c) 2020 huanzi-qch Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

SpringCloud系列Demo代码,每个子项目都是SpringCloud的一个知识点或者说技能点且都有对应的博客介绍,代码开箱即用适合新手学习或老司机复习 展开 收起
Java 等 2 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Java
1
https://gitee.com/huanzi-qch/springCloud.git
git@gitee.com:huanzi-qch/springCloud.git
huanzi-qch
springCloud
springCloud
master

搜索帮助