From 1ec8e822a17c37826b0a5df3b79ca03b4b528f1c Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Thu, 1 Aug 2019 14:42:01 +0200 Subject: [PATCH 1/2] Fix broken build --- .../elasticsearch/rest/RestClientConfigurations.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 735f27bd5a..dd75a659f2 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 - RestClientBuilder restClientBuilder(RestClientProperties properties, + public RestClientBuilder restClientBuilder(RestClientProperties properties, ObjectProvider builderCustomizers) { HttpHost[] hosts = properties.getUris().stream().map(HttpHost::create).toArray(HttpHost[]::new); RestClientBuilder builder = RestClient.builder(hosts); @@ -71,13 +71,13 @@ class RestClientConfigurations { @Bean @ConditionalOnMissingBean - RestHighLevelClient restHighLevelClient(RestClientBuilder restClientBuilder) { + public RestHighLevelClient restHighLevelClient(RestClientBuilder restClientBuilder) { return new RestHighLevelClient(restClientBuilder); } @Bean @ConditionalOnMissingBean - RestClient restClient(RestClientBuilder builder, ObjectProvider restHighLevelClient) { + public RestClient restClient(RestClientBuilder builder, ObjectProvider restHighLevelClient) { RestHighLevelClient client = restHighLevelClient.getIfUnique(); if (client != null) { return client.getLowLevelClient(); @@ -92,7 +92,7 @@ class RestClientConfigurations { @Bean @ConditionalOnMissingBean - RestClient restClient(RestClientBuilder builder) { + public RestClient restClient(RestClientBuilder builder) { return builder.build(); } From f2fd169c3afee66d88de22868e908016ff83c7e4 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Thu, 1 Aug 2019 14:45:33 +0200 Subject: [PATCH 2/2] Rename restClient to elasticsearchRestClient For consistency, similar beans have been renamed as well. Closes gh-17751 --- .../elasticsearch/rest/RestClientConfigurations.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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(); }