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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to