Coder Social home page Coder Social logo

tanbinh123 / springcloud Goto Github PK

View Code? Open in Web Editor NEW

This project forked from huanzi-qch/springcloud

0.0 1.0 0.0 524 KB

SpringCloud系列Demo代码,每个子项目都是SpringCloud的一个知识点或者说技能点且都有对应的博客介绍,代码开箱即用适合新手学习或老司机复习

License: MIT License

Java 99.22% HTML 0.78%

springcloud's Introduction

简介

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 动态路由
server-a
server-b1/b2
server-c
SpringCloud系列——Feign 服务调用
server-b1/b2 SpringCloud系列——Ribbon 负载均衡

QQ群

有事请加群,有问题进群大家一起交流! QQ群名:Java交流群-huanzi-qch QQ群号:1015379123
注:如果图片加载不出来请点击查看这里

捐献

请注意,作者五行缺钱,如果喜欢这个项目,请随意打赏!

支付宝

注:如果图片加载不出来请点击查看这里

微信

注:如果图片加载不出来请点击查看这里

学习资料

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

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

springcloud's People

Contributors

huanzi-qch avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.