You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "Linchen-Xu (via GitHub)" <gi...@apache.org> on 2023/09/26 14:49:31 UTC
[GitHub] [dubbo] Linchen-Xu commented on issue #13108: dubbo invocation上下文参数透传问题
Linchen-Xu commented on issue #13108:
URL: https://github.com/apache/dubbo/issues/13108#issuecomment-1735701276
你这里目前的整体流程是这样的:
1. 收到dubbo调用,provider filter在收到请求时从attachment中解出tag放到envContext中;
2. consumer filter在对下游进行dubbo调用时把tag放入attachment,调用下游;
3. 收到下游回复或因某些问题抛异常,执行consumer filter的finally里的代码,将envContext清空;
4. 如果有其他dubbo调用,重复2-3步;
5. 给上游返回调用结果,再次清空envContext。
实际上你在第一次dubbo调用(第三步的finally)那里就把context清空了,之后的调用中都是从没有tag的context里取标签。provider filter那里的清空操作也等同于没有生效,除非在其他地方的代码里往上下文加了参数。
如果想达到你要的效果,即上下文参数在给上游返回结果前一直生效的话,就把consumer filter的finally那部分删掉,在provider filter里清空一次参数就行了。
--
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