minor tweaks
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
09e7282b2b
commit
73fc3d34f0
10
http.go
10
http.go
@ -549,13 +549,15 @@ func (h *httpClient) publish(ctx context.Context, ps []client.Message, opts ...c
|
|||||||
exchange = v
|
exchange = v
|
||||||
}
|
}
|
||||||
|
|
||||||
|
omd, ok := metadata.FromOutgoingContext(ctx)
|
||||||
|
if !ok {
|
||||||
|
omd = metadata.New(2)
|
||||||
|
}
|
||||||
|
|
||||||
msgs := make([]*broker.Message, 0, len(ps))
|
msgs := make([]*broker.Message, 0, len(ps))
|
||||||
|
|
||||||
for _, p := range ps {
|
for _, p := range ps {
|
||||||
md, ok := metadata.FromOutgoingContext(ctx)
|
md := metadata.Copy(omd)
|
||||||
if !ok {
|
|
||||||
md = metadata.New(2)
|
|
||||||
}
|
|
||||||
md[metadata.HeaderContentType] = p.ContentType()
|
md[metadata.HeaderContentType] = p.ContentType()
|
||||||
md[metadata.HeaderTopic] = p.Topic()
|
md[metadata.HeaderTopic] = p.Topic()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user