We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
获取stub时判断了StringUtils.contains(stubClassName, "$"),但是我看到生成的class没有$符号
public AbstractStub getGrpcClient(ChannelCall channelPool, int callType, int callTimeout) { String stubClassName = GrpcStubClient.this.getStubClassName(); Channel channel = null; if (StringUtils.contains(stubClassName, "$")) { try { String parentName = StringUtils.substringBefore(stubClassName, "$"); Class<?> clzz = ReflectUtils.name2class(parentName); Method method; switch (callType) { case Constants.RPCTYPE_ASYNC: method = clzz.getMethod("newFutureStub", io.grpc.Channel.class); break; case Constants.RPCTYPE_BLOCKING: method = clzz.getMethod("newBlockingStub", io.grpc.Channel.class); break; default: method = clzz.getMethod("newFutureStub", io.grpc.Channel.class); break; } channel = channelPool.borrowChannel(refUrl); AbstractStub stubInstance = (AbstractStub) method.invoke(null, channel); return stubInstance; } catch (Exception e) { throw new IllegalArgumentException( "stub definition not correct,do not edit proto generat file", e); } finally { if (channel != null) { channelPool.returnChannel(refUrl, channel); } } } else { throw new IllegalArgumentException( "stub definition not correct,do not edit proto generat file"); } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
获取stub时判断了StringUtils.contains(stubClassName, "$"),但是我看到生成的class没有$符号
public AbstractStub getGrpcClient(ChannelCall channelPool, int callType, int callTimeout) {
String stubClassName = GrpcStubClient.this.getStubClassName();
Channel channel = null;
if (StringUtils.contains(stubClassName, "$")) {
try {
String parentName = StringUtils.substringBefore(stubClassName, "$");
Class<?> clzz = ReflectUtils.name2class(parentName);
Method method;
switch (callType) {
case Constants.RPCTYPE_ASYNC:
method = clzz.getMethod("newFutureStub", io.grpc.Channel.class);
break;
case Constants.RPCTYPE_BLOCKING:
method = clzz.getMethod("newBlockingStub", io.grpc.Channel.class);
break;
default:
method = clzz.getMethod("newFutureStub", io.grpc.Channel.class);
break;
}
channel = channelPool.borrowChannel(refUrl);
AbstractStub stubInstance = (AbstractStub) method.invoke(null, channel);
return stubInstance;
} catch (Exception e) {
throw new IllegalArgumentException(
"stub definition not correct,do not edit proto generat file", e);
} finally {
if (channel != null) {
channelPool.returnChannel(refUrl, channel);
}
}
} else {
throw new IllegalArgumentException(
"stub definition not correct,do not edit proto generat file");
}
}
The text was updated successfully, but these errors were encountered: