Hystrix默认方法

在我们的一种实现中,我们将hystrix用作断路器。 我们面临的问题是后备方法代码被复制,这违反了DRY的原理。除此之外,我们还有其他选择吗?

代码:后备方法如下所示-

public PaymentAuthVerifyResponse verifyChargesPreAuthFallback(String txnId) {
    PaymentAuthVerifyResponse response = new PaymentAuthVerifyResponse();
    return response;
}

public PaymentAuthVerifyResponse cancelPreAuthFallback(String txnId) {
    PaymentAuthVerifyResponse response = new PaymentAuthVerifyResponse();
    return response;
}

public PaymentAuthResponse chargePreAuthRequestFallback(PaymentAuthRequest chargeParams) {
    PaymentAuthResponse response = new PaymentAuthResponse();
    return response;
}
PIAOPIAOXUEYAOCHAOXI 回答:Hystrix默认方法

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3087171.html

大家都在问