lunar-shadow commented on code in PR #15506:
URL: https://github.com/apache/iceberg/pull/15506#discussion_r3078106618
##########
aws/src/main/java/org/apache/iceberg/aws/UrlConnectionHttpClientConfigurations.java:
##########
@@ -69,9 +77,26 @@ void configureUrlConnectionHttpClientBuilder(
urlConnectionHttpClientBuilder.socketTimeout(
Duration.ofMillis(httpClientUrlConnectionSocketTimeoutMs));
}
- if (proxyEndpoint != null) {
- urlConnectionHttpClientBuilder.proxyConfiguration(
-
ProxyConfiguration.builder().endpoint(URI.create(proxyEndpoint)).build());
+ configureProxy(urlConnectionHttpClientBuilder);
+ }
+
+ private void configureProxy(UrlConnectionHttpClient.Builder
urlConnectionHttpClientBuilder) {
+ if (proxyEndpoint != null
+ || proxyUseSystemPropertyValues != null
+ || proxyUseEnvironmentVariableValues != null) {
+ ProxyConfiguration.Builder proxyBuilder = ProxyConfiguration.builder();
+
+ if (proxyEndpoint != null) {
+ proxyBuilder.endpoint(URI.create(proxyEndpoint));
+ }
+ if (proxyUseSystemPropertyValues != null) {
+ proxyBuilder.useSystemPropertyValues(proxyUseSystemPropertyValues);
+ }
+ if (proxyUseEnvironmentVariableValues != null) {
+
proxyBuilder.useEnvironmentVariablesValues(proxyUseEnvironmentVariableValues);
Review Comment:
Thanks for the review @anuragmantri. I already looked into this and it turns
out the AWS SDK itself is inconsistent between its HTTP clients:
- URL Connection client uses plural [useEnvironmentVariablesValues()
](https://github.com/aws/aws-sdk-java-v2/blob/d4ceee0fa568bb0567862bc2ff926127a52164f7/http-clients/url-connection-client/src/main/java/software/amazon/awssdk/http/urlconnection/ProxyConfiguration.java#L254)
- Apache client uses singular[ useEnvironmentVariableValues()
](https://github.com/aws/aws-sdk-java-v2/blob/d4ceee0fa568bb0567862bc2ff926127a52164f7/http-clients/apache-client/src/main/java/software/amazon/awssdk/http/apache/ProxyConfiguration.java#L301)
Since we use the same property for both clients, I went with singular to
stay consistent with our own property constant
(PROXY_USE_ENVIRONMENT_VARIABLE_VALUES) and config key
(http-client.proxy-use-environment-variable-values).
Going plural would match the URL Connection side but mismatch the Apache
side and our own naming.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]