-
Notifications
You must be signed in to change notification settings - Fork 26.5k
New issue
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
fix the consumer remoteApplication is null #12635
Conversation
fix #12631 |
47f95f1
to
ac7d7d9
Compare
public void setUrl(URL url) { | ||
this.url = url; | ||
if (url.getSide().equals(CommonConstants.CONSUMER)) { | ||
this.remoteApplicationName = url.getRemoteApplication(); | ||
this.setRemoteAddress(url.getHost(), url.getPort()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set remote attribute in org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker#invokeWithContext
would be a better choice.
private static void setRemote(Invoker<?> invoker, Invocation invocation) {
invocation.addInvokedInvoker(invoker);
RpcContext.getServiceContext().setRemoteAddress(invoker.getUrl().toInetSocketAddress());
RpcContext.getServiceContext().setRemoteApplicationName(invoker.getUrl().getRemoteApplication());
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AlbumenJ hello, I have fix them,and I run the local test on filter can get them
@@ -107,8 +107,6 @@ protected Result doInvoke(final Invocation invocation) throws Throwable { | |||
|
|||
invocation.setAttachment(TIMEOUT_KEY, String.valueOf(timeout)); | |||
|
|||
RpcContext.getServiceContext().setRemoteAddress(currentClient.getRemoteAddress()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks,I will fix
14dc66f
to
3a0c31f
Compare
Kudos, SonarCloud Quality Gate passed! |
LGTM. Thx your contributions~ |
@AlbumenJ hello, did dubbo have a ding talk group,I have send a email to you,the qr code on the https://cn.dubbo.apache.org/zh-cn/contact/ is invalid |
You can add my dingtak directly. |
@AlbumenJ 3.1.8也遇到此问题,3.1.x是否有修复计划? |
What is the purpose of the change
#12631
Brief changelog
Verifying this change
Checklist
fix the consumer remoteApplicationName is null