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

Fix call Java provider occur error use group+version on triple protocol #2204

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions protocol/dubbo3/dubbo3_invoker.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import (
// same as dubbo_invoker.go attachmentKey
var attachmentKey = []string{
constant.InterfaceKey, constant.GroupKey, constant.TokenKey, constant.TimeoutKey,
constant.VersionKey,
constant.VersionKey, tripleConstant.TripleServiceGroup, tripleConstant.TripleServiceVersion,
}

// DubboInvoker is implement of protocol.Invoker, a dubboInvoker refer to one service and ip.
Expand Down Expand Up @@ -182,7 +182,17 @@ func (di *DubboInvoker) Invoke(ctx context.Context, invocation protocol.Invocati
}

for _, k := range attachmentKey {
if v := di.GetURL().GetParam(k, ""); len(v) > 0 {
var paramKey string
switch k {
case tripleConstant.TripleServiceGroup:
paramKey = constant.GroupKey
case tripleConstant.TripleServiceVersion:
paramKey = constant.VersionKey
default:
paramKey = k
}

if v := di.GetURL().GetParam(paramKey, ""); len(v) > 0 {
invocation.SetAttachment(k, v)
}
}
Expand Down