nanjiek commented on code in PR #3285:
URL: https://github.com/apache/dubbo-go/pull/3285#discussion_r3106509296


##########
protocol/triple/triple_invoker.go:
##########
@@ -202,18 +212,8 @@ func parseInvocation(ctx context.Context, url *common.URL, 
invocation base.Invoc
        return callType, inRaw, method, nil
 }
 
-// parseAttachments retrieves attachments from users passed-in and URL, then 
injects them into ctx
+// parseAttachments injects pre-defined URL attachments into invocation.
 func parseAttachments(ctx context.Context, url *common.URL, invocation 
base.Invocation) {
-       // retrieve users passed-in attachment
-       attaRaw := ctx.Value(constant.AttachmentKey)
-       if attaRaw != nil {
-               if userAtta, ok := attaRaw.(map[string]any); ok {
-                       for key, val := range userAtta {
-                               invocation.SetAttachment(key, val)
-                       }
-               }
-       }

Review Comment:
   attachment 的注入入口已经前移到了 client 层。现在用户通过 context 传入的 attachment,会在 
client.generateInvocation 阶段统一合并进 invocation.Attachments(),Triple invoker 
发送请求时只需要从 invocation 读取并写入 outgoing header,不需要再在 parseAttachments 里重复从 context 
回灌一次。



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