diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/mongo/MongoDataAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/mongo/MongoDataAutoConfiguration.java index 14a17c33c8..63c2ad1fe9 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/mongo/MongoDataAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/mongo/MongoDataAutoConfiguration.java @@ -18,8 +18,10 @@ package org.springframework.boot.autoconfigure.data.mongo; import java.util.Collections; +import com.mongodb.ClientSessionOptions; import com.mongodb.DB; import com.mongodb.MongoClient; +import com.mongodb.client.ClientSession; import com.mongodb.client.MongoDatabase; import org.springframework.beans.BeanUtils; @@ -182,6 +184,16 @@ public class MongoDataAutoConfiguration { return this.mongoDbFactory.getLegacyDb(); } + @Override + public ClientSession getSession(ClientSessionOptions options) { + return this.mongoDbFactory.getSession(options); + } + + @Override + public MongoDbFactory withSession(ClientSession session) { + return this.mongoDbFactory.withSession(session); + } + } } 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-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/redis/RedisAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/redis/RedisAutoConfigurationTests.java index 973204396c..658d2f31eb 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/redis/RedisAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/redis/RedisAutoConfigurationTests.java @@ -28,6 +28,7 @@ import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.test.context.runner.ApplicationContextRunner; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.data.redis.connection.RedisClusterConfiguration; import org.springframework.data.redis.connection.RedisNode; import org.springframework.data.redis.connection.lettuce.LettuceClientConfiguration.LettuceClientConfigurationBuilder; import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory; @@ -231,9 +232,17 @@ public class RedisAutoConfigurationTests { .withPropertyValues( "spring.redis.cluster.nodes[0]:" + clusterNodes.get(0), "spring.redis.cluster.nodes[1]:" + clusterNodes.get(1)) - .run((context) -> assertThat(context - .getBean(LettuceConnectionFactory.class).getClusterConnection()) - .isNotNull()); + .run((context) -> { + RedisClusterConfiguration clusterConfiguration = context + .getBean(LettuceConnectionFactory.class) + .getClusterConfiguration(); + assertThat(clusterConfiguration.getClusterNodes()).hasSize(2); + assertThat(clusterConfiguration.getClusterNodes()) + .extracting((node) -> node.getHost() + ":" + node.getPort()) + .containsExactlyInAnyOrder("127.0.0.1:27379", + "127.0.0.1:27380"); + }); + } @Test diff --git a/spring-boot-project/spring-boot-dependencies/pom.xml b/spring-boot-project/spring-boot-dependencies/pom.xml index 6d34aea1a5..beb7e00957 100644 --- a/spring-boot-project/spring-boot-dependencies/pom.xml +++ b/spring-boot-project/spring-boot-dependencies/pom.xml @@ -42,7 +42,7 @@ 2.1.4 1.7.11 2.6.2 - 3.4.0 + 3.5.0 1.3.4 1.11 2.2.0 @@ -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 @@ -116,7 +116,7 @@ 1.1.0 1.1.0 1.2.41 - 5.0.4.RELEASE + 5.1.0.M1 3.6.1 2.10.0 1.2.3 @@ -124,8 +124,8 @@ 2.2.3 1.0.4 2.18.3 - 1.7.1 - 3.6.3 + 1.9.0-beta1 + 3.8.0-beta2 6.2.2.jre8 5.1.46 5.8.1.Final @@ -150,12 +150,12 @@ 1.1.1 1.7.25 1.19 - 6.6.3 + 7.2.1 5.0.6.RELEASE 2.0.3.RELEASE 4.0.1.RELEASE 2.0.1.RELEASE - Kay-SR7 + Lovelace-BUILD-SNAPSHOT 0.24.0.RELEASE 5.0.5.RELEASE 2.2.0.BUILD-SNAPSHOT @@ -1531,6 +1531,11 @@ solr-langid ${solr.version} + + org.apache.solr + solr-ltr + ${solr.version} + org.apache.solr solr-solrj