fengcunhan edited a comment on issue #8738:
URL: https://github.com/apache/dubbo/issues/8738#issuecomment-916780084


   你使用错了API,如果要获取服务器端带来的参数,应该使用RpcContext.getServerContext()
   
   
   ` public void attachmentTest() {
           final String key = "user-attachment";
           final String value = "attachment-value";
           RpcContext.removeClientAttachment();
           RpcContext.getClientAttachment().setAttachment(key, value);
           
delegate.greetWithAttachment(GreeterRequest.newBuilder().setName("meta").build());
           final String returned = (String) 
RpcContext.**getServerContext**().getObjectAttachment(key);
           Assert.assertEquals(value, returned);
       } `
   


-- 
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