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

bugfix - triple protocol request doesn't carry attachment such as group or version. #1700

Merged
merged 8 commits into from
Jan 7, 2022

Conversation

ztelur
Copy link
Contributor

@ztelur ztelur commented Jan 4, 2022

Which issue(s) this PR fixes:

  • triple protocol request doesn't carry attachment such as group or version.

Special notes for your reviewer:

the client code in dubbo3_invoker is like below, so server use metadata.FromIncomingContext to get attachments from context

// append interface id to ctx
gRPCMD := make(metadata.MD, 0)
for k, v := range invocation.Attachments() {
if str, ok := v.(string); ok {
	gRPCMD.Set(k, str)
	continue
}
if str, ok := v.([]string); ok {
	gRPCMD.Set(k, str...)
	continue
}
logger.Warnf("triple attachment value with key = %s is invalid, which should be string or []string", k)
}
ctx = metadata.NewOutgoingContext(ctx, gRPCMD)
ctx = context.WithValue(ctx, tripleConstant.InterfaceKey, di.BaseInvoker.GetURL().GetParam(constant.InterfaceKey, ""))

LaurenceLiZhixin added a commit to LaurenceLiZhixin/dubbo-go that referenced this pull request Jan 5, 2022
LaurenceLiZhixin added a commit that referenced this pull request Jan 5, 2022
@LaurenceLiZhixin LaurenceLiZhixin merged commit ccf2dca into apache:3.0 Jan 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants