Merge branch 'lovelace-upgrade'

pull/13174/merge
Andy Wilkinson 7 years ago
commit 1f551e9e9c

@ -18,8 +18,10 @@ package org.springframework.boot.autoconfigure.data.mongo;
import java.util.Collections; import java.util.Collections;
import com.mongodb.ClientSessionOptions;
import com.mongodb.DB; import com.mongodb.DB;
import com.mongodb.MongoClient; import com.mongodb.MongoClient;
import com.mongodb.client.ClientSession;
import com.mongodb.client.MongoDatabase; import com.mongodb.client.MongoDatabase;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
@ -182,6 +184,16 @@ public class MongoDataAutoConfiguration {
return this.mongoDbFactory.getLegacyDb(); 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);
}
} }
} }

@ -62,12 +62,13 @@ public class RestClientAutoConfiguration {
@Bean(destroyMethod = "close") @Bean(destroyMethod = "close")
@ConditionalOnMissingBean @ConditionalOnMissingBean
public RestClient restClient() { public RestClient restClient(RestClientBuilder builder) {
RestClientBuilder builder = configureBuilder();
return builder.build(); return builder.build();
} }
protected RestClientBuilder configureBuilder() { @Bean
@ConditionalOnMissingBean
public RestClientBuilder restClientBuilder() {
HttpHost[] hosts = this.properties.getUris().stream().map(HttpHost::create) HttpHost[] hosts = this.properties.getUris().stream().map(HttpHost::create)
.toArray(HttpHost[]::new); .toArray(HttpHost[]::new);
RestClientBuilder builder = RestClient.builder(hosts); RestClientBuilder builder = RestClient.builder(hosts);
@ -90,8 +91,9 @@ public class RestClientAutoConfiguration {
@Bean @Bean
@ConditionalOnMissingBean @ConditionalOnMissingBean
public RestHighLevelClient restHighLevelClient(RestClient restClient) { public RestHighLevelClient restHighLevelClient(
return new RestHighLevelClient(restClient); RestClientBuilder restClientBuilder) {
return new RestHighLevelClient(restClientBuilder);
} }
} }

@ -28,6 +28,7 @@ import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.test.context.runner.ApplicationContextRunner; import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; 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.RedisNode;
import org.springframework.data.redis.connection.lettuce.LettuceClientConfiguration.LettuceClientConfigurationBuilder; import org.springframework.data.redis.connection.lettuce.LettuceClientConfiguration.LettuceClientConfigurationBuilder;
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory; import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
@ -231,9 +232,17 @@ public class RedisAutoConfigurationTests {
.withPropertyValues( .withPropertyValues(
"spring.redis.cluster.nodes[0]:" + clusterNodes.get(0), "spring.redis.cluster.nodes[0]:" + clusterNodes.get(0),
"spring.redis.cluster.nodes[1]:" + clusterNodes.get(1)) "spring.redis.cluster.nodes[1]:" + clusterNodes.get(1))
.run((context) -> assertThat(context .run((context) -> {
.getBean(LettuceConnectionFactory.class).getClusterConnection()) RedisClusterConfiguration clusterConfiguration = context
.isNotNull()); .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 @Test

@ -42,7 +42,7 @@
<bitronix.version>2.1.4</bitronix.version> <bitronix.version>2.1.4</bitronix.version>
<byte-buddy.version>1.7.11</byte-buddy.version> <byte-buddy.version>1.7.11</byte-buddy.version>
<caffeine.version>2.6.2</caffeine.version> <caffeine.version>2.6.2</caffeine.version>
<cassandra-driver.version>3.4.0</cassandra-driver.version> <cassandra-driver.version>3.5.0</cassandra-driver.version>
<classmate.version>1.3.4</classmate.version> <classmate.version>1.3.4</classmate.version>
<commons-codec.version>1.11</commons-codec.version> <commons-codec.version>1.11</commons-codec.version>
<commons-dbcp2.version>2.2.0</commons-dbcp2.version> <commons-dbcp2.version>2.2.0</commons-dbcp2.version>
@ -59,7 +59,7 @@
<embedded-mongo.version>2.0.3</embedded-mongo.version> <embedded-mongo.version>2.0.3</embedded-mongo.version>
<flyway.version>5.0.7</flyway.version> <flyway.version>5.0.7</flyway.version>
<freemarker.version>2.3.28</freemarker.version> <freemarker.version>2.3.28</freemarker.version>
<elasticsearch.version>5.6.9</elasticsearch.version> <elasticsearch.version>6.2.4</elasticsearch.version>
<glassfish-el.version>3.0.0</glassfish-el.version> <glassfish-el.version>3.0.0</glassfish-el.version>
<groovy.version>2.4.15</groovy.version> <groovy.version>2.4.15</groovy.version>
<gson.version>2.8.4</gson.version> <gson.version>2.8.4</gson.version>
@ -116,7 +116,7 @@
<junit-platform.version>1.1.0</junit-platform.version> <junit-platform.version>1.1.0</junit-platform.version>
<kafka.version>1.1.0</kafka.version> <kafka.version>1.1.0</kafka.version>
<kotlin.version>1.2.41</kotlin.version> <kotlin.version>1.2.41</kotlin.version>
<lettuce.version>5.0.4.RELEASE</lettuce.version> <lettuce.version>5.1.0.M1</lettuce.version>
<liquibase.version>3.6.1</liquibase.version> <liquibase.version>3.6.1</liquibase.version>
<log4j2.version>2.10.0</log4j2.version> <log4j2.version>2.10.0</log4j2.version>
<logback.version>1.2.3</logback.version> <logback.version>1.2.3</logback.version>
@ -124,8 +124,8 @@
<mariadb.version>2.2.3</mariadb.version> <mariadb.version>2.2.3</mariadb.version>
<micrometer.version>1.0.4</micrometer.version> <micrometer.version>1.0.4</micrometer.version>
<mockito.version>2.18.3</mockito.version> <mockito.version>2.18.3</mockito.version>
<mongo-driver-reactivestreams.version>1.7.1</mongo-driver-reactivestreams.version> <mongo-driver-reactivestreams.version>1.9.0-beta1</mongo-driver-reactivestreams.version>
<mongodb.version>3.6.3</mongodb.version> <mongodb.version>3.8.0-beta2</mongodb.version>
<mssql-jdbc.version>6.2.2.jre8</mssql-jdbc.version> <mssql-jdbc.version>6.2.2.jre8</mssql-jdbc.version>
<mysql.version>5.1.46</mysql.version> <mysql.version>5.1.46</mysql.version>
<narayana.version>5.8.1.Final</narayana.version> <narayana.version>5.8.1.Final</narayana.version>
@ -150,12 +150,12 @@
<simple-json.version>1.1.1</simple-json.version> <simple-json.version>1.1.1</simple-json.version>
<slf4j.version>1.7.25</slf4j.version> <slf4j.version>1.7.25</slf4j.version>
<snakeyaml.version>1.19</snakeyaml.version> <snakeyaml.version>1.19</snakeyaml.version>
<solr.version>6.6.3</solr.version> <solr.version>7.2.1</solr.version>
<spring.version>5.0.6.RELEASE</spring.version> <spring.version>5.0.6.RELEASE</spring.version>
<spring-amqp.version>2.0.3.RELEASE</spring-amqp.version> <spring-amqp.version>2.0.3.RELEASE</spring-amqp.version>
<spring-batch.version>4.0.1.RELEASE</spring-batch.version> <spring-batch.version>4.0.1.RELEASE</spring-batch.version>
<spring-cloud-connectors.version>2.0.1.RELEASE</spring-cloud-connectors.version> <spring-cloud-connectors.version>2.0.1.RELEASE</spring-cloud-connectors.version>
<spring-data-releasetrain.version>Kay-SR7</spring-data-releasetrain.version> <spring-data-releasetrain.version>Lovelace-BUILD-SNAPSHOT</spring-data-releasetrain.version>
<spring-hateoas.version>0.24.0.RELEASE</spring-hateoas.version> <spring-hateoas.version>0.24.0.RELEASE</spring-hateoas.version>
<spring-integration.version>5.0.5.RELEASE</spring-integration.version> <spring-integration.version>5.0.5.RELEASE</spring-integration.version>
<spring-kafka.version>2.2.0.BUILD-SNAPSHOT</spring-kafka.version> <spring-kafka.version>2.2.0.BUILD-SNAPSHOT</spring-kafka.version>
@ -1531,6 +1531,11 @@
<artifactId>solr-langid</artifactId> <artifactId>solr-langid</artifactId>
<version>${solr.version}</version> <version>${solr.version}</version>
</dependency> </dependency>
<dependency>
<groupId>org.apache.solr</groupId>
<artifactId>solr-ltr</artifactId>
<version>${solr.version}</version>
</dependency>
<dependency> <dependency>
<groupId>org.apache.solr</groupId> <groupId>org.apache.solr</groupId>
<artifactId>solr-solrj</artifactId> <artifactId>solr-solrj</artifactId>

Loading…
Cancel
Save