Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dubbo-go client, dubbo-Java server, server can't get "remote.application" key attachment #2752

Open
zhangcunli opened this issue Nov 29, 2024 · 3 comments
Labels
good first issue Good for newcomers

Comments

@zhangcunli
Copy link

Environment

  • Server: Dubbo-Java, v3.3.0
  • Client: Dubbo-go, v3.2.0-rc2
  • Protocol: tri
  • Registry: zookeeper

Issue description

Server can't get "remote.application" key from attachment.

Logs

1.client, dubbo-go v3.2.0-rc2

		atm := make(map[string]interface{})
		atm["key1"] = "value1"
		atm["remote.application"] = "appname"
		atm["remote.application2"] = "appname"
		ctx1 := context.WithValue(context.Background(), v3constant.AttachmentKey, atm)

2.server:

        Map<String, Object> serverAttachments = RpcContext.getServerAttachment().getObjectAttachments();
        System.out.println("ContextService serverAttachments:" + JSON.toJSONString(serverAttachments));
  1. server print:
{
    "key1": "value1",
    "retries": "",
    "remote.application2": "appname"
}
"remote.application" key is null
@AlexStocks
Copy link
Contributor

zhangcunli 反馈:如果把 “remote.application” 发送到 dubbo 端,这个 attachment 就丢失了

@solisamicus
Copy link

For reference, there's a related article that might help: Reference Article. Hope it helps!

@AlexStocks
Copy link
Contributor

这里先给出结论:这不是一个 bug,之所以 attachment 中 key 为 "remote.application" 的 item 在 dubbo server 端被过滤掉,是因为该 key 是 dubbo(Java) attachment 中的保留字段,不允许用户使用。

Image

@AlexStocks AlexStocks added the good first issue Good for newcomers label Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants