Set kafka MaxAttempts to 1

This leaves it to the ExportWithAttempts function to handle the
connect attempts.
This commit is contained in:
ionutboangiu
2024-04-10 17:19:10 +03:00
committed by Dan Christian Bogos
parent e025a0dc89
commit 88b02a3249

View File

@@ -76,9 +76,12 @@ func (pstr *KafkaEE) Connect() (_ error) {
defer pstr.Unlock()
if pstr.writer == nil {
pstr.writer = &kafka.Writer{
Addr: kafka.TCP(pstr.Cfg().ExportPath),
Topic: pstr.topic,
MaxAttempts: pstr.Cfg().Attempts,
Addr: kafka.TCP(pstr.Cfg().ExportPath),
Topic: pstr.topic,
// Leave it to the ExportWithAttempts function
// to handle the connect attempts.
MaxAttempts: 1,
}
}
if pstr.tls {