You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+80Lines changed: 80 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -370,6 +370,86 @@ repositories {
370
370
}
371
371
```
372
372
373
+
## AWS OpenSearch Serverless support
374
+
375
+
For applications and services that use AWS OpenSearch Serverless offerings, the default clients will not work out of the box.
376
+
377
+
### Connecting AWS OpenSearch Serverless with OpenSearch RestClient
378
+
379
+
When using OpenSearch RestClient, the instance of `AwsRequestSigningApacheV5Interceptor` (see please [aws-request-signing-apache-interceptor](ttps://github.com/acm19/aws-request-signing-apache-interceptor) should be configured and injected into request interceptors chain. The sample configuration is provided below:
380
+
381
+
```
382
+
@Configuration
383
+
public class OpenSearchAwsClientConfiguration {
384
+
@Value("${aws.os.region}")
385
+
private String region = "";
386
+
387
+
@Bean
388
+
RestClientBuilderCustomizer customizer() {
389
+
return new RestClientBuilderCustomizer() {
390
+
@Override
391
+
public void customize(HttpAsyncClientBuilder builder) {
public void customize(RestClientBuilder builder) {
402
+
// No additional customizations needed
403
+
}
404
+
};
405
+
}
406
+
}
407
+
```
408
+
409
+
### Connecting AWS OpenSearch Serverless with OpenSearch Java Client
410
+
411
+
When using OpenSearch Java Client, the instance of the `AwsSdk2Transport` should be configured instead of the default one. The sample configuration is provided below:
412
+
413
+
```
414
+
@Configuration
415
+
public class OpenSearchAwsClientConfiguration extends OpenSearchConfiguration {
416
+
@Value("${aws.os.endpoint}")
417
+
private String endpoint = "";
418
+
419
+
@Value("${aws.os.region}")
420
+
private String region = "";
421
+
422
+
@Value("${aws.os.username}")
423
+
private String username = "";
424
+
425
+
@Value("${aws.os.password}")
426
+
private String password = "";
427
+
428
+
@NonNull
429
+
@Override
430
+
public ClientConfiguration clientConfiguration() {
431
+
return ClientConfiguration.builder()
432
+
.connectedTo(endpoint)
433
+
.usingSsl()
434
+
.withBasicAuth(username,password)
435
+
.withConnectTimeout(Duration.ofSeconds(10))
436
+
.withSocketTimeout(Duration.ofSeconds(5))
437
+
.build();
438
+
}
439
+
440
+
@Override
441
+
public OpenSearchTransport opensearchTransport(RestClient restClient, JsonpMapper jsonpMapper) {
442
+
final SdkHttpClient httpClient = ApacheHttpClient.builder().build();
443
+
return new AwsSdk2Transport(
444
+
httpClient,
445
+
endpoint,
446
+
"es" // signing service name, use "aoss" for OpenSearch Serverless
447
+
region,
448
+
AwsSdk2TransportOptions.builder().build());
449
+
}
450
+
}
451
+
```
452
+
373
453
## Reporting Issues
374
454
375
455
Spring Data OpenSearch uses GitHub as issue tracking system to record bugs and feature requests.
0 commit comments