From d3e8d1533f0e87ed0a283580c3567bee95e4c908 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Mon, 17 May 2021 12:05:46 +0100 Subject: [PATCH] Upgrade to R2DBC Bom Arabba-SR10 Closes gh-26563 --- spring-boot-project/spring-boot-dependencies/build.gradle | 2 +- .../springframework/boot/r2dbc/ConnectionFactoryBuilder.java | 2 ++ .../boot/r2dbc/ConnectionFactoryBuilderTests.java | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-dependencies/build.gradle b/spring-boot-project/spring-boot-dependencies/build.gradle index 2fbf093956..162e166939 100644 --- a/spring-boot-project/spring-boot-dependencies/build.gradle +++ b/spring-boot-project/spring-boot-dependencies/build.gradle @@ -1389,7 +1389,7 @@ bom { ] } } - library("R2DBC Bom", "Arabba-SR9") { + library("R2DBC Bom", "Arabba-SR10") { group("io.r2dbc") { imports = [ "r2dbc-bom" diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/r2dbc/ConnectionFactoryBuilder.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/r2dbc/ConnectionFactoryBuilder.java index 125f0a3eb8..9ad371e883 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/r2dbc/ConnectionFactoryBuilder.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/r2dbc/ConnectionFactoryBuilder.java @@ -231,6 +231,8 @@ public final class ConnectionFactoryBuilder { ConnectionFactory connectionFactory) { ConnectionPoolConfiguration.Builder builder = ConnectionPoolConfiguration.builder(connectionFactory); PropertyMapper map = PropertyMapper.get().alwaysApplyingWhenNonNull(); + map.from((Object) options.getValue(PoolingConnectionFactoryProvider.BACKGROUND_EVICTION_INTERVAL)) + .as(this::toDuration).to(builder::backgroundEvictionInterval); map.from((Object) options.getValue(PoolingConnectionFactoryProvider.INITIAL_SIZE)).as(this::toInteger) .to(builder::initialSize); map.from((Object) options.getValue(PoolingConnectionFactoryProvider.MAX_SIZE)).as(this::toInteger) diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/r2dbc/ConnectionFactoryBuilderTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/r2dbc/ConnectionFactoryBuilderTests.java index 06abd175a1..78bdce0982 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/r2dbc/ConnectionFactoryBuilderTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/r2dbc/ConnectionFactoryBuilderTests.java @@ -232,6 +232,9 @@ class ConnectionFactoryBuilderTests { ACQUIRE_RETRY(PoolingConnectionFactoryProvider.ACQUIRE_RETRY, 4, "acquireRetry"), + BACKGROUND_EVICTION_INTERVAL(PoolingConnectionFactoryProvider.BACKGROUND_EVICTION_INTERVAL, + Duration.ofSeconds(120), "backgroundEvictionInterval"), + INITIAL_SIZE(PoolingConnectionFactoryProvider.INITIAL_SIZE, 2, "initialSize"), MAX_SIZE(PoolingConnectionFactoryProvider.MAX_SIZE, 8, "maxSize"),