badaiaqrandista commented on a change in pull request #8644:
URL: https://github.com/apache/kafka/pull/8644#discussion_r431622505
##########
File path: clients/src/main/java/org/apache/kafka/clients/ClientUtils.java
##########
@@ -108,10 +108,11 @@ public static ChannelBuilder
createChannelBuilder(AbstractConfig config, Time ti
static List<InetAddress> resolve(String host, ClientDnsLookup
clientDnsLookup) throws UnknownHostException {
InetAddress[] addresses = InetAddress.getAllByName(host);
- if (ClientDnsLookup.USE_ALL_DNS_IPS == clientDnsLookup) {
- return filterPreferredAddresses(addresses);
- } else {
+ if (ClientDnsLookup.USE_FIRST_DNS_IP == clientDnsLookup) {
return Collections.singletonList(addresses[0]);
+ } else {
+ // ClientDnsLookup.USE_ALL_DNS_IPS == clientDnsLookup ||
ClientDnsLookup.DEFAULT == clientDnsLookup
+ return filterPreferredAddresses(addresses);
}
Review comment:
Yes, you are correct. If
`client.dns.lookup=RESOLVE_CANONICAL_BOOTSTRAP_SERVERS_ONLY` , then it will
resolves the hostname to IP address using the default behaviour.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]