client/noop: fix MessageMetadata option
lint / lint (pull_request) Successful in 1m18s Details
pr / test (pull_request) Successful in 1m1s Details

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2023-10-26 03:06:39 +03:00
parent 1c703f0f0c
commit 089e7b6812
1 changed files with 7 additions and 0 deletions

View File

@ -490,6 +490,13 @@ func (n *noopClient) publish(ctx context.Context, ps []Message, opts ...PublishO
if !ok {
md = metadata.New(0)
}
iter := p.Metadata().Iterator()
var k, v string
for iter.Next(&k, &v) {
md.Set(k, v)
}
md[metadata.HeaderContentType] = p.ContentType()
topic := p.Topic()