diff --git a/README.md b/README.md index 3f40ac9..c87a5c6 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,7 @@ Check out on [go-dcp](https://github.com/Trendyol/go-dcp#configuration) | `kafka.producerBatchSize` | integer | no | 2000 | Maximum message count for batch, if exceed flush will be triggered. | | `kafka.producerBatchBytes` | 64 bit integer | no | 10485760 | Maximum size(byte) for batch, if exceed flush will be triggered. | | `kafka.producerBatchTimeout` | time.duration | no | 1 nano second | Time limit on how often incomplete message batches will be flushed. | -| `kafka.producerMaxAttempts` | int | no | 10 | Limit on how many attempts will be made to deliver a message. | +| `kafka.producerMaxAttempts` | int | no | math.MaxInt | Limit on how many attempts will be made to deliver a message. | | `kafka.producerBatchTickerDuration` | time.Duration | no | 10s | Batch is being flushed automatically at specific time intervals for long waiting messages in batch. | | `kafka.readTimeout` | time.Duration | no | 30s | segmentio/kafka-go - Timeout for read operations | | `kafka.writeTimeout` | time.Duration | no | 30s | segmentio/kafka-go - Timeout for write operations | diff --git a/config/config.go b/config/config.go index f901b5f..02467f8 100644 --- a/config/config.go +++ b/config/config.go @@ -1,6 +1,7 @@ package config import ( + "math" "time" "github.com/Trendyol/go-dcp/config" @@ -71,7 +72,7 @@ func (c *Connector) ApplyDefaults() { } if c.Kafka.ProducerMaxAttempts == 0 { - c.Kafka.ProducerMaxAttempts = 10 + c.Kafka.ProducerMaxAttempts = math.MaxInt } if c.Kafka.ProducerBatchTimeout == 0 {