Spring Cloud
文章平均质量分 60
佛说"獨"
这个作者很懒,什么都没留下…
展开
-
@Component 注入到其它包下的方法
一,1,在启动类上声明注解 @ComponentScan 在里面填写 @Component注解所在的包路径,可以多路径配置@SpringBootApplication@EnableOpenApi // 路径:/swagger-ui/index.html@ComponentScan("com.abdas.common.MybatisPlus")public class ServiceApplication { public static void main(String[] args) {原创 2021-08-27 09:53:14 · 1898 阅读 · 0 评论 -
OpenFeign和Hystrix超时时长设置及详解
概念明确:hystrix可配置的部分:hystrix.command.default.execution.timeout.enable=true //为false则超时控制有ribbon控制,为true则hystrix超时和ribbon超时都是用,但是谁小谁生效,默认为truehystrix.command.default.execution.isolation.thread.timeoutInMilliseconds=3000//熔断器的超时时长默认1秒,最常修改的参数circuitBreak转载 2020-10-10 11:29:21 · 3323 阅读 · 0 评论 -
Hystrix 用法,@HystrixProperty参数说明
Hystrix 用法及注解用法一、hystrix参数使用方法通过注解@HystrixCommand的commandProperties去配置,如下就是hystrix命令超时时间命令执行超时时间,为1000ms和执行是不启用超时@RestControllerpublic class MovieController { @Autowired private RestTemplate restTemplate; @GetMapping("/movie/{id}") @HystrixCo转载 2020-10-09 17:02:56 · 6247 阅读 · 0 评论