Merge pull request #79 from unistack-org/kgo-context

propogate context to kgo record
This commit is contained in:
Василий Толстов 2022-10-11 11:57:30 +03:00 committed by GitHub
commit 7390973672
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

2
kgo.go
View File

@ -262,7 +262,7 @@ func (k *kBroker) publish(ctx context.Context, msgs []*broker.Message, opts ...b
} }
for _, msg := range msgs { for _, msg := range msgs {
rec := &kgo.Record{Key: key} rec := &kgo.Record{Context: ctx, Key: key}
rec.Topic, _ = msg.Header.Get(metadata.HeaderTopic) rec.Topic, _ = msg.Header.Get(metadata.HeaderTopic)
if k.opts.Codec.String() == "noop" { if k.opts.Codec.String() == "noop" {
rec.Value = msg.Body rec.Value = msg.Body