tulios / kafkajs

A modern Apache Kafka client for node.js
https://kafka.js.org
MIT License
3.71k stars 525 forks source link

Increate KafkaJS producer default retry #1673

Open TiansuYu opened 5 months ago

TiansuYu commented 5 months ago

KafkaJs use a default retry = 5, which is extremely small for any internet intermittent issues. The default settings in Java client / Kafka doc in contrast, use MAX_INT as the default value (and they explained why that is the case / recommended value in production). It would make the configs consistent if KafkaJS could follow the same convention. Especially for teams managing interactions with all kinds of Kafka clients for Enterprise.

Ofc, in the end, this is a decision that has to be made by KafkaJS. But IMHO, it would be great that we could follow a consistent convention across different libs to ease communication and minimize surprises in production environments.

unematiii commented 2 months ago

I believe you can specify what that value should be. The real problem with the the retry counter is that it never resets and applies to all errors regardless if they were successfully retried or not.