【熔断器Hystrix】

【熔断器Hystrix】_第1张图片
【熔断器Hystrix】_第2张图片
【熔断器Hystrix】_第3张图片
在这里插入图片描述
【熔断器Hystrix】_第4张图片
【熔断器Hystrix】_第5张图片

 <dependency>

            <groupId>org.springframework.cloud</groupId>

            <artifactId>spring-cloud-starter-netflix-ribbon</artifactId>

        </dependency>


        <!--hystrix依赖,主要是用  @HystrixCommand -->

        <dependency>

            <groupId>org.springframework.cloud</groupId>

            <artifactId>spring-cloud-starter-netflix-hystrix</artifactId>

        </dependency>


        <!--服务注册-->

        <dependency>

            <groupId>org.springframework.cloud</groupId>

            <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>

        </dependency>

        <!--服务调用-->

        <dependency>

            <groupId>org.springframework.cloud</groupId>

            <artifactId>spring-cloud-starter-openfeign</artifactId>

        </dependency>

在这里插入图片描述

#开启熔断机制
feign.hystrix.enabled=true

# 设置hystrix超时时间,默认1000ms
hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds=6000

【熔断器Hystrix】_第6张图片
【熔断器Hystrix】_第7张图片

你可能感兴趣的:(项目知识点)