It is common to have:
- broker with a dynamic IP -> we should not cache the DNS lookup
- broker name that resolves with multiple IPs -> in case of failure we should try the next IP
Confluent recommends the following configuration:
At java level:
At Kafka consumer and producer level with:
The java configuration will be global and it changes the dns cache from infinite to 30s which should be ok.