use of co.elastic.clients.transport.ElasticsearchTransport in project micronaut-elasticsearch by micronaut-projects.
the class DefaultElasticsearchClientFactory method elasticsearchTransport.
/**
* @param elasticsearchConfiguration The {@link DefaultElasticsearchConfigurationProperties} object.
* @param objectMapper The {@link ObjectMapper} object.
* @return The {@link ElasticsearchTransport}.
* @since 4.2.0
*/
@Singleton
@Bean(preDestroy = "close")
ElasticsearchTransport elasticsearchTransport(DefaultElasticsearchConfigurationProperties elasticsearchConfiguration, ObjectMapper objectMapper) {
RestClient restClient = restClientBuilder(elasticsearchConfiguration).build();
ElasticsearchTransport transport = new RestClientTransport(restClient, new JacksonJsonpMapper(objectMapper));
return transport;
}
Aggregations