Skip to content

Commit

Permalink
Merge pull request #72 from Raj-Adarsh/a5_processor_v9
Browse files Browse the repository at this point in the history
fix: updated processor batch flush size
  • Loading branch information
Raj-Adarsh authored Jun 28, 2024
2 parents 2cdeed7 + 09b913a commit 31be996
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions internal/kafka/kafka.go
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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 {
Expand Down

0 comments on commit 31be996

Please sign in to comment.