diff --git a/internal/kafka/kafka.go b/internal/kafka/kafka.go index 3241745..abac7e3 100644 --- a/internal/kafka/kafka.go +++ b/internal/kafka/kafka.go @@ -1,10 +1,11 @@ package kafka import ( + "time" + "github.com/IBM/sarama" _ "github.com/rs/zerolog" "github.com/rs/zerolog/log" - "time" ) type Service interface { @@ -23,7 +24,8 @@ func NewProducer(brokers []string) (Producer, error) { config.ChannelBufferSize = 10000 config.Net.MaxOpenRequests = 250 config.Metadata.AllowAutoTopicCreation = false - config.Producer.Flush.Frequency = 20 * time.Millisecond + config.Producer.Flush.Messages = 1000 + config.Producer.Flush.Frequency = 500 * time.Millisecond producer, err := sarama.NewSyncProducer(brokers, config) if err != nil {