Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions kq/pusher.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,13 @@ type (

func NewPusher(addrs []string, topic string, opts ...PushOption) *Pusher {
producer := &kafka.Writer{
Addr: kafka.TCP(addrs...),
Topic: topic,
Addr: kafka.TCP(addrs...),
Topic: topic,
//todo move the follwoing to config kpusherConfig?
Balancer: &kafka.LeastBytes{},
Compression: kafka.Snappy,
//if this is not set, the writer will not create a nonexistent topic
AllowAutoTopicCreation: true,
}
pusher := &Pusher{
producer: producer,
Expand Down