Skip to content

Commit

Permalink
Merge pull request #67 from TYashodaKrishna/maxBytes
Browse files Browse the repository at this point in the history
Add kafka producer option top set max record size
  • Loading branch information
apoorvprecisely authored Nov 30, 2023
2 parents fe16520 + 7829666 commit d468c4a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions transport/kafka/producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ func WithMaxAttemptsProducerOption(attempts int) ProducerOption {
return func(p *Producer) { p.config.MaxAttempts = attempts }
}

// WithMaxBatchBytesOption sets the maximum bytes of record size
// kafka producer will try to produce
func WithMaxBatchBytesOption(batchBytes int64) ProducerOption {
return func(p *Producer) { p.config.BatchBytes = int(batchBytes) }
}

// WithQueueCapacityProducerOption sets the internal buffer capacity
// used to cache incoming messages before publishing on kafka
func WithQueueCapacityProducerOption(qc int) ProducerOption {
Expand Down

0 comments on commit d468c4a

Please sign in to comment.