Merge pull request 'fix server subscriber' (#103) from idfix into master
Some checks failed
build / test (push) Failing after 1m28s
build / lint (push) Failing after 2m40s
codeql / analyze (go) (push) Failing after 3m5s

Reviewed-on: #103
This commit is contained in:
Василий Толстов 2023-08-24 09:32:34 +03:00
commit c069636bf3

View File

@ -122,6 +122,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 {