Skip to content

Commit

Permalink
Address code review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
  • Loading branch information
reta committed May 23, 2023
1 parent 3cb2441 commit f82028b
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions USER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,15 @@ There are multiple low level transports which `OpenSearchClient` could be config
### Create a client using `RestClientTransport`

```java
//Initialize the client with SSL and TLS enabled
import org.apache.http.HttpHost;

final HttpHost[] hosts = new HttpHost[] {
new HttpHost("localhost", 9200, "http")
};

// Initialize the client with SSL and TLS enabled
final RestClient restClient = RestClient
.builder(hosts).
.builder(hosts)
.build();

OpenSearchTransport transport = new RestClientTransport(restClient, new JacksonJsonpMapper());
Expand All @@ -98,6 +104,12 @@ Upcoming OpenSearch `3.0.0` release brings HTTP/2 support and as such, the `Rest
### Create a client using `ApacheHttpClient5Transport`

```java
import org.apache.hc.core5.http.HttpHost;

final HttpHost[] hosts = new HttpHost[] {
new HttpHost("localhost", "http", 9200)
};

final OpenSearchTransport transport = ApacheHttpClient5TransportBuilder
.builder(hosts)
.setMapper(new JacksonJsonpMapper())
Expand Down

0 comments on commit f82028b

Please sign in to comment.