pangshuqiang commented on issue #8365:
URL: https://github.com/apache/dubbo/issues/8365#issuecomment-888894281


   ### 》》》》》 Consumer 端的 ClientAttachment 会传递到 Provider 端的 
ServerAttachment,Provider 端的 ServerContext 会传回递 Consumer 端的 Result
   
   补充一下测试结果,如下:
   
   /******* Consumer setValue --> Provider  getValue *********/
   
**Consumer:**`RpcContext.getClientAttachment().setAttachment(WebConstEnum.Model.TP_NUM,
 MDC.get(WebConstEnum.Model.TP_NUM));`
   **Provider 
:**`RpcContext.getServerAttachment().getAttachment(WebConstEnum.Model.TP_NUM);`
   
   /******** Provider  setValue --> Consumer getValue *********/
   **Provider :** `result.setAttachment(WebConstEnum.Model.TIMESTAMP, "" + l);` 
 
   or 
`RpcContext.getServerContext().setAttachment(WebConstEnum.Model.TIMESTAMP, 
""+System.currentTimeMillis());`
   **Consumer:**`result.getAttachment(WebConstEnum.Model.TIMESTAMP, "-1");`
   
   非常感谢 @AlbumenJ ,thank you!


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