使用泛化调用,不能够使用到提供者配置的参数,如重试时间。
- Dubbo version: 2.6.0
- Operating System version: macOS
- Java version: 1.8.0_101
使用泛化调用时,在FailoverClusterInvoker.java中的doInvoke中的
int len = getUrl().getMethodParameter(invocation.getMethodName(), Constants.RETRIES_KEY, Constants.DEFAULT_RETRIES) + 1;
invocation.getMethodName()只能读取到$invoke方法,这样就拿不到在提供者设置的具体参数了,期望这里可以判断如果是泛化调用,则通过泛化调用设置的方法名去拿取参数。
@Referece 的参数RETRIES 也不能获取到。
这里 应该 使用
RpcUtils.getMethodName(Invocation invocation) 得到方法名,如DubboInvoker 中拿取timeout的实现
final String methodName = RpcUtils.getMethodName(invocation);
.....
int timeout = getUrl().getMethodParameter(methodName, Constants.TIMEOUT_KEY, Constants.DEFAULT_TIMEOUT);
could you please send a pr?
您好, 是这样的, 准确的说,如果把@Service /@Reference 的retries 设置为0, 则会走默认的2次