turcsanyip commented on code in PR #5990:
URL: https://github.com/apache/nifi/pull/5990#discussion_r874169556
##########
nifi-nar-bundles/nifi-azure-bundle/nifi-azure-processors/src/main/java/org/apache/nifi/processors/azure/storage/utils/AzureStorageUtils.java:
##########
@@ -311,4 +316,34 @@ public static void setProxy(final OperationContext
operationContext, final Proce
final ProxyConfiguration proxyConfig =
ProxyConfiguration.getConfiguration(processContext);
operationContext.setProxy(proxyConfig.createProxy());
}
+
+ public static void configureProxy(final NettyAsyncHttpClientBuilder
nettyClientBuilder, final PropertyContext propertyContext) {
Review Comment:
It would be less coupled if `NettyAsyncHttpClientBuilder` was not passed in
but the method returned the `ProxyOptions` object instead. The caller can set
`ProxyOptions` on the builder and this method would not be bound to that
implementation.
Additional note:
I think the following code should work on the caller side:
```
BlobServiceClientBuilder clientBuilder = new BlobServiceClientBuilder();
ProxyOptions proxyOptions = AzureStorageUtils.configureProxy(context);
ClientOptions clientOptions = new
HttpClientOptions().setProxyOptions(proxyOptions);
clientBuilder.clientOptions(clientOptions);
```
but there seems to be a bug in the Azure client library and `ProxyOptions`
is not passed in this way.
That's why we need to use `NettyAsyncHttpClientBuilder`. Once it is fixed,
we can get rid of `NettyAsyncHttpClientBuilder` on the caller side too.
Opened an issue for fixing it:
https://github.com/Azure/azure-sdk-for-java/issues/28900
--
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]