From 88b02a32494228d640e783a0c0a075bebd294ccd Mon Sep 17 00:00:00 2001 From: ionutboangiu Date: Wed, 10 Apr 2024 17:19:10 +0300 Subject: [PATCH] Set kafka MaxAttempts to 1 This leaves it to the ExportWithAttempts function to handle the connect attempts. --- ees/kafka.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ees/kafka.go b/ees/kafka.go index 10c7ca14a..607c91b96 100644 --- a/ees/kafka.go +++ b/ees/kafka.go @@ -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 {