一 依赖注解
Jar:
Spring-cloud-starter-hystrix
注解:
@EnableCircuiBreaker
@HystrixCommand
二 设置超时
Hystrix:
Command:
Default:---也可以是方法名。如果是【default】表示全局设置,如果是方法名表示只对改方法有效
Execution:
Isolation:
Thread:
timeoutMilliseconds:3000
三 熔断器
Jar:
Spring-cloud-starter-hystrix
注解:
@EnableCircuiBreaker
@HystrixCommand
Hystrix:
Command:
Default:---也可以是方法名。如果是【default】表示全局设置,如果是方法名表示只对改方法有效
Execution:
Isolation:
Thread:
timeoutMilliseconds:3000
本文标题:hystrix
本文链接:https://www.haomeiwen.com/subject/heyndctx.html
网友评论