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
rpc 调用之后,想知道调用远端的ip port, 从rpc上下文获取到的接口发现都是null的 RpcContext.getContext().getChannel() RpcContext.getContext().getRemoteAddress()
The text was updated successfully, but these errors were encountered:
只能自己新建一个Brpc Proxy,在里面添加对应的代码:
if (request.getCommunicationClient() != null) { SocketAddress socketAddress = new InetSocketAddress( request.getCommunicationClient().getServiceInstance().getIp(), request.getCommunicationClient().getServiceInstance().getPort()); RpcContext.getContext().setRemoteAddress(socketAddress); } currentTryTimes++; }
Sorry, something went wrong.
可以加一个Interceptor , 在拦截器里面获取 request.getCommunicationClient().getServiceInstance().getIp()
No branches or pull requests
rpc 调用之后,想知道调用远端的ip port,
从rpc上下文获取到的接口发现都是null的
RpcContext.getContext().getChannel()
RpcContext.getContext().getRemoteAddress()
The text was updated successfully, but these errors were encountered: