frankvicky commented on code in PR #21080:
URL: https://github.com/apache/kafka/pull/21080#discussion_r3655548834
##########
clients/src/main/java/org/apache/kafka/clients/ClientUtils.java:
##########
@@ -201,6 +247,17 @@ public static NetworkClient
createNetworkClient(AbstractConfig config,
metricsGroupPrefix,
channelBuilder,
logContext);
+ ClientDnsLookup dnsLookup =
ClientDnsLookup.forConfig(config.getString(CommonClientConfigs.CLIENT_DNS_LOOKUP_CONFIG));
+
+ NetworkClient.BootstrapConfiguration bootstrapConfiguration =
+ (bootstrapServers != null && !bootstrapServers.isEmpty())
Review Comment:
That branch was dead. Every `ClientUtils.createNetworkClient` caller is
guaranteed non-empty:
- Producer/Consumer: `bootstrap.servers` is validated with
`anyNonDuplicateValues(false, false)` (empty not allowed)
- Admin: `determineBootstrapType` throws `ConfigException` if neither
`bootstrap.servers` nor `bootstrap.controllers` is set
The `DISABLED` path is only used by broker-side code
(`NodeToControllerChannelManagerImpl`, `NetworkUtils`,
`ReplicaVerificationTool`, `BrokerApiVersionsCommand`,
`ConnectionStressWorker`), and those construct `NetworkClient` directly — they
never go through `ClientUtils`. Simplified to always use `enabled(...)`.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]