You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/08/14 09:17:04 UTC
[GitHub] [dubbo] AlbumenJ commented on a diff in pull request #10456: fxi GenericFilter 从 Attachment 中获取generic参数获取不到的问题
AlbumenJ commented on code in PR #10456:
URL: https://github.com/apache/dubbo/pull/10456#discussion_r945256748
##########
dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/filter/GenericFilter.java:
##########
@@ -97,7 +97,7 @@ public Result invoke(Invoker<?> invoker, Invocation inv) throws RpcException {
String generic = inv.getAttachment(GENERIC_KEY);
if (StringUtils.isBlank(generic)) {
- generic = RpcContext.getClientAttachment().getAttachment(GENERIC_KEY);
+ generic = RpcContext.getServerAttachment().getAttachment(GENERIC_KEY);
}
Review Comment:
这段逻辑应该是为了适配之前 http/hessian 协议的实现的,由于老的实现是直接用的 RpcContext.getContext().setAttachment(GENERIC_KEY, xxx) 来配置的,所以这个修改后会影响正常使用。最好这里是能有一个 fallback 的逻辑,从 invocation => server attachment => client attachment。
--
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