From 148997fd43507a74f26d0494e67c5dc3e5714c43 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Tue, 15 May 2018 16:40:34 +0100 Subject: [PATCH] Upgrade to Elasticsearch 6.2.4 Closes gh-13178 --- .../rest/RestClientAutoConfiguration.java | 12 +++++++----- spring-boot-project/spring-boot-dependencies/pom.xml | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/rest/RestClientAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/rest/RestClientAutoConfiguration.java index ea68b2624d..1f99a2b859 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/rest/RestClientAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/rest/RestClientAutoConfiguration.java @@ -62,12 +62,13 @@ public class RestClientAutoConfiguration { @Bean(destroyMethod = "close") @ConditionalOnMissingBean - public RestClient restClient() { - RestClientBuilder builder = configureBuilder(); + public RestClient restClient(RestClientBuilder builder) { return builder.build(); } - protected RestClientBuilder configureBuilder() { + @Bean + @ConditionalOnMissingBean + public RestClientBuilder restClientBuilder() { HttpHost[] hosts = this.properties.getUris().stream().map(HttpHost::create) .toArray(HttpHost[]::new); RestClientBuilder builder = RestClient.builder(hosts); @@ -90,8 +91,9 @@ public class RestClientAutoConfiguration { @Bean @ConditionalOnMissingBean - public RestHighLevelClient restHighLevelClient(RestClient restClient) { - return new RestHighLevelClient(restClient); + public RestHighLevelClient restHighLevelClient( + RestClientBuilder restClientBuilder) { + return new RestHighLevelClient(restClientBuilder); } } diff --git a/spring-boot-project/spring-boot-dependencies/pom.xml b/spring-boot-project/spring-boot-dependencies/pom.xml index 62eca1edba..0998baf4da 100644 --- a/spring-boot-project/spring-boot-dependencies/pom.xml +++ b/spring-boot-project/spring-boot-dependencies/pom.xml @@ -59,7 +59,7 @@ 2.0.3 5.0.7 2.3.28 - 5.6.9 + 6.2.4 3.0.0 2.4.15 2.8.4