通过application.yml外部化Hystrix配置

时间:2018-12-26 16:20:16

标签: spring-boot spring-cloud spring-cloud-netflix hystrix

我有一个启用hystrix后备的方法:

@HystrixCommand(fallbackMethod = "fallbackExecute")
public void execute() {
  // some logic goes here
}

public void fallBackExecute() {
  // some fallback logic goes here
}

有没有一种方法可以使用hystrix的属性配置后备方法,而无需使用@HystrixCommand批注,以避免在代码中紧密结合后备方法。

如果有人尝试过类似的方法,请在此处分享。

谢谢。

0 个答案:

没有答案
相关问题