improve tracing
Some checks failed
build / test (push) Failing after 25s
build / lint (push) Successful in 22s
codeql / analyze (go) (push) Failing after 46s

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2024-07-22 23:45:23 +03:00
parent 894d6f4f20
commit e66194695e
3 changed files with 40 additions and 16 deletions

3
kgo.go
View File

@@ -6,6 +6,7 @@ import (
"errors"
"fmt"
"math/rand"
"net/http"
"strings"
"sync"
"time"
@@ -275,7 +276,7 @@ func (k *Broker) publish(ctx context.Context, msgs []*broker.Message, opts ...br
if options.BodyOnly || k.opts.Codec.String() == "noop" {
rec.Value = msg.Body
for k, v := range msg.Header {
rec.Headers = append(rec.Headers, kgo.RecordHeader{Key: k, Value: []byte(v)})
rec.Headers = append(rec.Headers, kgo.RecordHeader{Key: http.CanonicalHeaderKey(k), Value: []byte(v)})
}
} else {
rec.Value, err = k.opts.Codec.Marshal(msg)