davsclaus commented on code in PR #24320:
URL: https://github.com/apache/camel/pull/24320#discussion_r3589075212
##########
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:
This line is ~200 chars and will overflow in the rendered docs. Please break
it across multiple lines for readability, e.g.:
```java
OpenSearchTransport transport = new AwsSdk2Transport(
httpClient, host, Region.of(region),
AwsSdk2TransportOptions.builder()
.setCredentials(buildCredentialsProvider())
.setMapper(new JacksonJsonpMapper(mapper))
.build());
```
##########
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);
+
+getContext().getRegistry().bind("customClient", customClient);
+
+from("direct:deleteIndex")
+ .to("opensearch://foo?openSearchClient=#customClient");
+
+DeleteIndexRequest.Builder builder = new
DeleteIndexRequest.Builder().index("twitter");
+Boolean status = template().requestBody("direct:deleteIndex", builder,
Boolean.class);
+----
+
Review Comment:
**Missing closing `====`:** This `[tabs]` block (opened at line 412) is
never closed. Every other tabs block in this file has a matching `====`.
Without it, AsciiDoc rendering breaks from this point onward.
Please add `====` after this line:
```suggestion
----
====
```
--
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]