twmb / franz-go

franz-go contains a feature complete, pure Go library for interacting with Kafka from 0.8.0 through 3.6+. Producing, consuming, transacting, administrating, etc.
BSD 3-Clause "New" or "Revised" License
1.6k stars 158 forks source link

Documentation request / question #768

Closed asg0451 closed 1 week ago

asg0451 commented 3 weeks ago

I've been struggling to understand exactly how franz does batching/buffering of records. If I'm sending in record after record for a given topic-partition, how large will franz's batches be? And is there a way to configure it. What is the procedure it uses? Reading the code and available options did not enlighten me.

twmb commented 1 week ago

https://pkg.go.dev/github.com/twmb/franz-go/pkg/kgo#ProducerBatchMaxBytes https://pkg.go.dev/github.com/twmb/franz-go/pkg/kgo#ProducerLinger