Skip to content

Commit f25d26e

Browse files
committed
Fix: Set current time instead of epoch 0(1970-01-01T00:00:00) in kafka message metadata
1 parent 8230bc9 commit f25d26e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

output_kafka.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ package goreplay
22

33
import (
44
"encoding/json"
5-
"github.com/buger/goreplay/internal/byteutils"
6-
"github.com/buger/goreplay/proto"
75
"log"
86
"strings"
97
"time"
108

9+
"github.com/buger/goreplay/internal/byteutils"
10+
"github.com/buger/goreplay/proto"
11+
1112
"github.com/Shopify/sarama"
1213
"github.com/Shopify/sarama/mocks"
1314
)
@@ -91,8 +92,9 @@ func (o *KafkaOutput) PluginWrite(msg *Message) (n int, err error) {
9192
}
9293

9394
o.producer.Input() <- &sarama.ProducerMessage{
94-
Topic: o.config.Topic,
95-
Value: message,
95+
Topic: o.config.Topic,
96+
Value: message,
97+
Timestamp: time.Now(),
9698
}
9799

98100
return len(message), nil

0 commit comments

Comments
 (0)