dubbo-go icon indicating copy to clipboard operation
dubbo-go copied to clipboard

The client cannot obtain the attachment set by the server

Open ziyyun opened this issue 5 months ago • 3 comments

Environment

  • Server: Dubbo-go, v3.3.0
  • Client: Dubbo-go, v3.3.0
  • Protocol: Triple
  • Registry: zookeeper

Issue description

Server:

result := invoker.Invoke(ctx, invocation) result.AddAttachment("code", zcode.CODE_SUCCESS) return result

Client:

result := invoker.Invoke(ctx, invocation) _, ok := result.Attachments()["code"]

The client cannot obtain the attachment. I didn't see response with attachment in the source code.

ziyyun avatar Jun 24 '25 04:06 ziyyun

发现开发分支有一个提交和这个问题相关 #2854 ,但无法保证新老版本一致性,无法满足https://github.com/apache/dubbo-go-samples/tree/main/compatibility/filter/custom ,使用上也偏复杂。

ziyyun avatar Jun 25 '25 03:06 ziyyun

已提交修改 #2927

ziyyun avatar Jun 26 '25 06:06 ziyyun

Thanks!

marsevilspirit avatar Jun 26 '25 08:06 marsevilspirit