renjth-81 commented on code in PR #24320:
URL: https://github.com/apache/camel/pull/24320#discussion_r3594076625
##########
components/camel-opensearch/src/main/docs/opensearch-component.adoc:
##########
@@ -406,3 +406,29 @@ MsearchRequest.Builder builder = new
MsearchRequest.Builder().index("twitter").s
.body(new MultisearchBody.Builder().query(b -> b.matchAll(x ->
x)).build()).build());
List<MultiSearchResponseItem<?>> response =
template.requestBody("direct:multiSearch", builder, List.class);
----
+
+=== Custom OpenSearchClient Example
+
+DeleteIndex operation using a custom OpenSearchClient that uses AWS SDK
transport. When both restClient and openSearchClient are present in registry,
openSearchClient takes precedence over restClient.
+
+[tabs]
+====
+Java::
++
+[source,java]
+----
+SdkHttpClient httpClient = ApacheHttpClient.builder().build();
+final ObjectMapper mapper = new ObjectMapper();
+mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
+OpenSearchTransport transport = new AwsSdk2Transport(httpClient, host,
Region.of(region),AwsSdk2TransportOptions.builder().setCredentials(buildCredentialsProvider()).setMapper(new
JacksonJsonpMapper(mapper)).build());
+OpenSearchClient customClient = new OpenSearchClient(transport);
+
Review Comment:
fixed
--
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]