Skip to content

Commit

Permalink
Fix: #2178 (#2204)
Browse files Browse the repository at this point in the history
  • Loading branch information
CodingAdai committed Feb 8, 2023
1 parent 6deedc3 commit d2dccc4
Showing 1 changed file with 12 additions and 2 deletions.
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

0 comments on commit d2dccc4

Please sign in to comment.