入口
1 | css复制代码@EnableCircuitBreaker 这注解也能开启Hystrix的相关功能 |
其中读取spring.factories哪个文件的入口在此org.springframework.cloud.commons.util.SpringFactoryImportSelector#selectImports
1 | typescript复制代码public String[] selectImports(AnnotationMetadata metadata) { |
现在知道对应配置是怎么自动读取的吧!
相关源码分析
核心逻辑com.netflix.hystrix.contrib.javanica.aop.aspectj.HystrixCommandAspect#methodsAnnotatedWithHystrixCommand
1 | ini复制代码@Around("hystrixCommandAnnotationPointcut() || hystrixCollapserAnnotationPointcut()") |
封装
默认为
SYNCHRONOUS
下面是Rxjava的相关编程,个人不是很熟
执行成功的逻辑
这里就是调用的逻辑,由于是使用reactor模式的调用,我也做不了详细的解释,惭愧啊!
推荐相关的源码解释:www.iocoder.cn/categories/…
本文转载自: 掘金