You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "chaoyoung (via GitHub)" <gi...@apache.org> on 2023/03/10 16:06:24 UTC
[GitHub] [dubbo] chaoyoung opened a new issue, #11790: The remote address could not be obtained from the context after the request
chaoyoung opened a new issue, #11790:
URL: https://github.com/apache/dubbo/issues/11790
### Environment
* Dubbo version: 3.1.6
* Operating System version: macOS 13.2
* Java version: 1.8.0_362
### Steps to reproduce this issue
1. add a filter in consumer
```java
@Slf4j
public class RpcContextFilter implements Filter {
@Override
public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {
log.info("invoker url: {}:{}", invoker.getUrl().getHost(), invoker.getUrl().getPort());
Result result = invoker.invoke(invocation);
log.info("remote address: {}", RpcContext.getContext().getRemoteAddress());
return result;
}
}
```
2. resources/META-INF/dubbo/org.apache.dubbo.rpc.Filter配置内容
```properties
rpcContextFilter=org.example.dubbo.filter.RpcContextFilter
```
3. dubbo consumer dependency
```java
@DubboReference(filter = "rpcContextFilter")
```
4. After a request, the filter prints the log as follows:
```
2023-03-10 19:08:45.667 INFO 77228 --- [nio-8081-exec-1] o.example.dubbo.filter.RpcContextFilter : invoker url: 10.9.0.162:50051
2023-03-10 19:08:45.817 INFO 77228 --- [nio-8081-exec-1] o.example.dubbo.filter.RpcContextFilter : remote address: null
```
### Expected Behavior
The remote address can be obtained.
### Actual Behavior
The remote address is empty
If there is an exception, please attach the exception trace:
```
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [I] The remote address could not be obtained from the context after the request [dubbo]
Posted by "CrazyHZM (via GitHub)" <gi...@apache.org>.
CrazyHZM closed issue #11790: The remote address could not be obtained from the context after the request
URL: https://github.com/apache/dubbo/issues/11790
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
[GitHub] [dubbo] AlbumenJ commented on issue #11790: The remote address could not be obtained from the context after the request
Posted by "AlbumenJ (via GitHub)" <gi...@apache.org>.
AlbumenJ commented on issue #11790:
URL: https://github.com/apache/dubbo/issues/11790#issuecomment-1491472315
Fixed in https://github.com/apache/dubbo/pull/11824
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
[GitHub] [dubbo] songxiaosheng commented on issue #11790: The remote address could not be obtained from the context after the request
Posted by "songxiaosheng (via GitHub)" <gi...@apache.org>.
songxiaosheng commented on issue #11790:
URL: https://github.com/apache/dubbo/issues/11790#issuecomment-1491389944
<img width="1099" alt="image" src="https://user-images.githubusercontent.com/81170548/229042380-38bcc3fe-d0ce-4493-aa95-a01f6ce4e0ba.png">
You can temporarily retrieve it from the invoker object
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org