How to configure the client in opensearch-java client library?

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):

AWS OpenSearch 2.17

Describe the issue:

I am trying to connect to an AWS Opensearch 2.17 from my ECS.
I was using the Elasticsearch 6.6.0 client library previously where I was using an interceptor and setHttpClientConfigCallback to set the following configurations in the RestClient: setMaxConnTotal, setIoThreadCount, setMaxRetryTimeoutMillis

I haven’t been able to migrate this setup into the OpenSearch java client library since the high-level rest client seems deprecated. This is the setup I require.

new RestHighLevelClient(RestClient
        .builder(HttpHost.create("my_os_url")
        .setHttpClientConfigCallback(hacb -> hacb.addInterceptorLast(interceptor).setMaxConnTotal(1)
            .setDefaultIOReactorConfig(IOReactorConfig.custom().setIoThreadCount(500).build()))
        .setMaxRetryTimeoutMillis(60 * 1000));

Can someone help me set this up in the opensearch-java library?

I have tried using the apachev5 interceptor as well similar to what’s mentioned https://forum.opensearch.org/t/signing-request-with-apache-httpclient-5-transport/18333 but I faced the same issue

Please check [1], there is a dedicated AWS transport to connect to AWS managed services, thank you

[1] opensearch-java/guides/auth.md at main · opensearch-project/opensearch-java · GitHub