Merge pull request 'fix server subscriber' (#102) from idfix into v3
Some checks failed
build / test (push) Failing after 1m28s
build / lint (push) Failing after 2m44s
codeql / analyze (go) (push) Failing after 3m4s

Reviewed-on: #102
This commit is contained in:
Василий Толстов 2023-08-24 09:25:28 +03:00
commit c1fa0f991d

View File

@ -123,6 +123,7 @@ func NewServerSubscriberWrapper() server.SubscriberWrapper {
if id, ok := msg.Header()[DefaultMetadataKey]; ok { if id, ok := msg.Header()[DefaultMetadataKey]; ok {
imd.Set(DefaultMetadataKey, id) imd.Set(DefaultMetadataKey, id)
omd.Set(DefaultMetadataKey, id) omd.Set(DefaultMetadataKey, id)
ctx = context.WithValue(ctx, XRequestIDKey, id)
ctx = metadata.NewIncomingContext(ctx, imd) ctx = metadata.NewIncomingContext(ctx, imd)
ctx = metadata.NewOutgoingContext(ctx, omd) ctx = metadata.NewOutgoingContext(ctx, omd)
} else if ctx, err = DefaultMetadataFunc(ctx); err != nil { } else if ctx, err = DefaultMetadataFunc(ctx); err != nil {