fix #333 : regression bug introduced by sarama library

This commit is contained in:
Nicolas Reboul 2018-07-03 14:27:01 +02:00 committed by Josh Baker
parent d09508edd3
commit 7ffb7686c2
1 changed files with 3 additions and 0 deletions

View File

@ -60,6 +60,9 @@ func (conn *KafkaConn) Send(msg string) error {
cfg.Net.DialTimeout = time.Second cfg.Net.DialTimeout = time.Second
cfg.Net.ReadTimeout = time.Second * 5 cfg.Net.ReadTimeout = time.Second * 5
cfg.Net.WriteTimeout = time.Second * 5 cfg.Net.WriteTimeout = time.Second * 5
// Fix #333 : fix backward incompatibility introduced by sarama library
cfg.Producer.Return.Successes = true
c, err := sarama.NewSyncProducer([]string{uri}, cfg) c, err := sarama.NewSyncProducer([]string{uri}, cfg)
if err != nil { if err != nil {
return err return err