请教利用fegin进行远程访问设置Hystrix熔断器不生效

本人的环境
1.基于spring boot 2.0.4的 spring cloud(Finchley.SR1)
2.分为eureka,merber,order。order通过Fegin的方式调用merber的一个方法
困惑
远程调用 利用注解@HystrixCommand的方式熔断器可以起作用,

但是利用这种方式就不行

代码展示:
pom.xml



    4.0.0

    com.msop.order
    order
    0.0.1-SNAPSHOT
    jar

    order
    Demo project for Spring Boot

 
        org.springframework.boot
        spring-boot-starter-parent
        2.0.4.RELEASE
         
    

    
        UTF-8
        UTF-8
        1.8
        Finchley.SR1
    

    
        
            org.springframework.boot
            spring-boot-starter-web
        
        
            org.springframework.cloud
            spring-cloud-starter-netflix-eureka-client
        
        
            org.springframework.cloud
            spring-cloud-starter-netflix-hystrix
        
        
            org.springframework.cloud
            spring-cloud-starter-openfeign
        

    

    
        
            
                org.springframework.cloud
                spring-cloud-dependencies
                ${spring-cloud.version}
                pom
                import
            
        
    

    
        
            
                org.springframework.boot
                spring-boot-maven-plugin
            
        
    

application.properties

spring.application.name=order
server.port=3001
server.tomcat.max-threads=20
eureka.client.service-url.defaultZone=http://localhost:1001/eureka/

fegin.hystrix.enabled=true
hystrix.command.default.exection.isolation.thread.timeoutInMilliseconds=4000
ribbon.ReadTimeOut=4000
ribbon.ConnectTimeOut=4000

OrderApplication启动文件

Fegin接口文件

Fegin fallback类

控制文件

转载于:https://blog.51cto.com/12091844/2305422

你可能感兴趣的:(请教利用fegin进行远程访问设置Hystrix熔断器不生效)