@@ -3,6 +3,7 @@ package kgo
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"strconv"
|
||||||
"sync"
|
"sync"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"time"
|
"time"
|
||||||
@@ -238,6 +239,11 @@ func (pc *consumer) consume() {
|
|||||||
for _, hdr := range record.Headers {
|
for _, hdr := range record.Headers {
|
||||||
p.msg.Header.Set(hdr.Key, string(hdr.Value))
|
p.msg.Header.Set(hdr.Key, string(hdr.Value))
|
||||||
}
|
}
|
||||||
|
p.msg.Header.Set("Micro-Offset", strconv.FormatInt(record.Offset, 10))
|
||||||
|
p.msg.Header.Set("Micro-Partition", strconv.FormatInt(int64(record.Partition), 10))
|
||||||
|
p.msg.Header.Set("Micro-Topic", record.Topic)
|
||||||
|
p.msg.Header.Set("Micro-Key", string(record.Key))
|
||||||
|
p.msg.Header.Set("Micro-Timestamp", strconv.FormatInt(record.Timestamp.Unix(), 10))
|
||||||
if pc.kopts.Codec.String() == "noop" {
|
if pc.kopts.Codec.String() == "noop" {
|
||||||
p.msg.Body = record.Value
|
p.msg.Body = record.Value
|
||||||
} else if pc.opts.BodyOnly {
|
} else if pc.opts.BodyOnly {
|
||||||
|
|||||||
Reference in New Issue
Block a user