【发布时间】:2018-09-23 06:23:30
【问题描述】:
我的项目中有以下代码
@HystrixCommand(groupKey = "AddressRepository", commandKey =
"getAddressById", threadPoolKey = "addressSearchPool")
public List<Address> getAddressById(String id)
throws MyCustomException, HystrixRuntimeException {
try (Connection con = sql2o.open()) {
return // some logic....
} catch (Sql2oException e) {
throw new MyCustomException();
}
}
如您所见,@HystrixCommand 没有定义任何 fallbackMethod。我想知道 HystrixCommand 在这里服务的目的是什么。
没有定义回退时使用 HystrixCommand 的用例是什么?
代码是 Spring 应用程序的一部分。
【问题讨论】: