peterlaszlohei commented on PR #56:
URL: 
https://github.com/apache/flink-connector-opensearch/pull/56#issuecomment-4266615861

   @uliandim Hey, thanks for putting this together!
   
   I was looking through the changes and noticed there isn't a way to configure 
the underlying HTTP client yet. This is a requirement for people using Amazon 
OpenSearch, as we need to inject an AWS SigV4 request signer (like 
[AwsRequestSigningApacheV5Interceptor](https://github.com/acm19/aws-request-signing-apache-interceptor))
 to authenticate.
   
   In the OpenSearch 2 connector, we could use `setRestClientFactory` to 
completely override the default HTTP client setup. It would be great to have an 
equivalent for OS3. Since the OS3 integration drops the `RestClient` and uses 
`ApacheHttpClient5TransportBuilder` instead, we'd essentially need a way to 
pass a custom `HttpClientConfigCallback`.
   
   We could do this by introducing a `Serializable` interface, for example:
   ```
   @FunctionalInterface
   public interface Opensearch3HttpClientConfigCallback extends 
ApacheHttpClient5TransportBuilder.HttpClientConfigCallback, Serializable {
   }
   ```
   We could make this be part of the `NetworkClientConfig` and expose it 
through the `Opensearch3SinkBuilder`. If provided, this could be used in the 
`OpenSearch3Writer`'s `createTransport` method to completely bypass the default 
hardcoded basic auth/SSL setup, giving the user full control over the client 
configuration.
   
   This is obviously not the only way of adding support for this but I tested 
this on a fork and it works. Let me know what you think!


-- 
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]

Reply via email to