Package org.opensearch.data.client.osc
Class ReactiveOpenSearchConfiguration
java.lang.Object
org.springframework.data.elasticsearch.config.ElasticsearchConfigurationSupport
org.opensearch.data.client.osc.ReactiveOpenSearchConfiguration
public abstract class ReactiveOpenSearchConfiguration
extends org.springframework.data.elasticsearch.config.ElasticsearchConfigurationSupport
Base class for a @
Configuration class to set up the OpenSearch
connection using the ReactiveOpenSearchClient. This class exposes different parts of the setup as Spring
beans. Deriving * classes must provide the ClientConfiguration to use.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract org.springframework.data.elasticsearch.client.ClientConfigurationMust be implemented by deriving classes to provide theClientConfiguration.org.opensearch.client.RestClientelasticsearchRestClient(org.springframework.data.elasticsearch.client.ClientConfiguration clientConfiguration) Provides the underlying low level RestClient.org.opensearch.client.json.JsonpMapperProvides the JsonpMapper that is used in theopensearchTransport(RestClient, JsonpMapper)method and exposes it as a bean.org.opensearch.client.transport.OpenSearchTransportopensearchTransport(org.opensearch.client.RestClient restClient, org.opensearch.client.json.JsonpMapper jsonpMapper) Provides the Elasticsearch transport to be used.org.springframework.data.elasticsearch.core.ReactiveElasticsearchOperationsreactiveElasticsearchOperations(org.springframework.data.elasticsearch.core.convert.ElasticsearchConverter elasticsearchConverter, ReactiveOpenSearchClient reactiveElasticsearchClient) CreatesReactiveElasticsearchOperations.reactiveOpenSearchClient(org.opensearch.client.transport.OpenSearchTransport transport) Provides theReactiveOpenSearchClientinstance used.org.opensearch.client.transport.TransportOptionsMethods inherited from class org.springframework.data.elasticsearch.config.ElasticsearchConfigurationSupport
elasticsearchCustomConversions, elasticsearchEntityMapper, elasticsearchMappingContext, fieldNamingStrategy, getInitialEntitySet, getMappingBasePackages, refreshPolicy, scanForEntities, writeTypeHints
-
Constructor Details
-
ReactiveOpenSearchConfiguration
public ReactiveOpenSearchConfiguration()
-
-
Method Details
-
clientConfiguration
@Bean(name="elasticsearchClientConfiguration") public abstract org.springframework.data.elasticsearch.client.ClientConfiguration clientConfiguration()Must be implemented by deriving classes to provide theClientConfiguration.- Returns:
- configuration, must not be null
-
elasticsearchRestClient
@Bean public org.opensearch.client.RestClient elasticsearchRestClient(org.springframework.data.elasticsearch.client.ClientConfiguration clientConfiguration) Provides the underlying low level RestClient.- Parameters:
clientConfiguration- configuration for the client, must not be null- Returns:
- RestClient
-
opensearchTransport
@Bean public org.opensearch.client.transport.OpenSearchTransport opensearchTransport(org.opensearch.client.RestClient restClient, org.opensearch.client.json.JsonpMapper jsonpMapper) Provides the Elasticsearch transport to be used. The default implementation uses theRestClientbean and theJsonpMapperbean provided in this class.- Returns:
- the
OpenSearchTransport - Since:
- 5.2
-
reactiveOpenSearchClient
@Bean public ReactiveOpenSearchClient reactiveOpenSearchClient(org.opensearch.client.transport.OpenSearchTransport transport) Provides theReactiveOpenSearchClientinstance used.- Parameters:
transport- the OpenSearchTransport to use- Returns:
- ReactiveOpenSearchClient instance.
-
reactiveElasticsearchOperations
@Bean(name={"reactiveElasticsearchOperations","reactiveElasticsearchTemplate","reactiveOpensearchOperations","reactiveOpensearchTemplate"}) public org.springframework.data.elasticsearch.core.ReactiveElasticsearchOperations reactiveElasticsearchOperations(org.springframework.data.elasticsearch.core.convert.ElasticsearchConverter elasticsearchConverter, ReactiveOpenSearchClient reactiveElasticsearchClient) CreatesReactiveElasticsearchOperations.- Returns:
- never null.
-
jsonpMapper
@Bean public org.opensearch.client.json.JsonpMapper jsonpMapper()Provides the JsonpMapper that is used in theopensearchTransport(RestClient, JsonpMapper)method and exposes it as a bean.- Returns:
- the
JsonpMapperto use - Since:
- 5.2
-
transportOptions
public org.opensearch.client.transport.TransportOptions transportOptions()- Returns:
- the options that should be added to every request. Must not be null
-