diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/rest/RestClientConfigurations.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/rest/RestClientConfigurations.java index dd75a659f2..f6b4a495c2 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/rest/RestClientConfigurations.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/rest/RestClientConfigurations.java @@ -46,7 +46,7 @@ class RestClientConfigurations { @Bean @ConditionalOnMissingBean - public RestClientBuilder restClientBuilder(RestClientProperties properties, + public RestClientBuilder elasticsearchRestClientBuilder(RestClientProperties properties, ObjectProvider builderCustomizers) { HttpHost[] hosts = properties.getUris().stream().map(HttpHost::create).toArray(HttpHost[]::new); RestClientBuilder builder = RestClient.builder(hosts); @@ -71,13 +71,14 @@ class RestClientConfigurations { @Bean @ConditionalOnMissingBean - public RestHighLevelClient restHighLevelClient(RestClientBuilder restClientBuilder) { + public RestHighLevelClient elasticsearchRestHighLevelClient(RestClientBuilder restClientBuilder) { return new RestHighLevelClient(restClientBuilder); } @Bean @ConditionalOnMissingBean - public RestClient restClient(RestClientBuilder builder, ObjectProvider restHighLevelClient) { + public RestClient elasticsearchRestClient(RestClientBuilder builder, + ObjectProvider restHighLevelClient) { RestHighLevelClient client = restHighLevelClient.getIfUnique(); if (client != null) { return client.getLowLevelClient(); @@ -92,7 +93,7 @@ class RestClientConfigurations { @Bean @ConditionalOnMissingBean - public RestClient restClient(RestClientBuilder builder) { + public RestClient elasticsearchRestClient(RestClientBuilder builder) { return builder.build(); }