@@ -35,12 +35,16 @@ func NewProducer(c *resolver.ConfigMap) (*Producer, error) {
3535 "bootstrap.servers" : bootstrap_host ,
3636 "acks" : - 1 ,
3737 "go.delivery.reports" : true ,
38- "queue.buffering.max.ms" : 10 ,
39- "queue.buffering.max.messages" : 100000 ,
40- "queue.buffering.max.bytes" : 1048576 ,
41- "linger.ms" : 10 ,
42- "num.network.threads" : 10 ,
38+ "batch.num.messages" : 10000 , // By default, a batch can buffer up to 10,000 messages to form a MessageSet for batch sending, enhancing performance.
39+ "batch.size" : 1000000 , //The limit for the total size of a MessageSet batch, by default not exceeding 1,000,000 bytes.
40+ "queue.buffering.max.ms" : 5 , //The delay before transmitting message batches (MessageSets) to the Broker to buffer messages, 5 ms by default.
41+ "queue.buffering.max.messages" : 100000 , //The total number of messages buffered by the Producer should not exceed 100,000.
42+ "queue.buffering.max.kbytes" : 1048576 , //MessageSets for the Producer buffering messages.
43+ "message.send.max.retries" : 2147483647 , //Number of retries, 2,147,483,647 by default.
4344 })
45+ if err != nil {
46+ return nil , err
47+ }
4448
4549 ctx , cancel := context .WithCancel (context .Background ())
4650
0 commit comments