Skip to content

Commit 6fb70d1

Browse files
committed
Map R2DBC Pool 'minIdle' property
Closes gh-32332
1 parent 6d2a1d3 commit 6fb70d1

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/r2dbc/ConnectionFactoryBuilder.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,8 @@ ConnectionPoolConfiguration connectionPoolConfiguration(ConnectionFactoryOptions
244244
.to(builder::maxIdleTime);
245245
map.from(options.getValue(PoolingConnectionFactoryProvider.MAX_CREATE_CONNECTION_TIME)).as(this::toDuration)
246246
.to(builder::maxCreateConnectionTime);
247+
map.from(options.getValue(PoolingConnectionFactoryProvider.MIN_IDLE)).as(this::toInteger)
248+
.to(builder::minIdle);
247249
map.from(options.getValue(PoolingConnectionFactoryProvider.POOL_NAME)).as(this::toString).to(builder::name);
248250
map.from(options.getValue(PoolingConnectionFactoryProvider.PRE_RELEASE)).to((function) -> builder
249251
.preRelease((Function<? super Connection, ? extends Publisher<Void>>) function));

spring-boot-project/spring-boot/src/test/java/org/springframework/boot/r2dbc/ConnectionFactoryBuilderTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ private enum ExpectedOption {
265265
MAX_CREATE_CONNECTION_TIME(PoolingConnectionFactoryProvider.MAX_CREATE_CONNECTION_TIME, Duration.ofSeconds(10),
266266
"maxCreateConnectionTime"),
267267

268-
MIN_IDLE(PoolingConnectionFactoryProvider.MIN_IDLE, 0, "minIdle"),
268+
MIN_IDLE(PoolingConnectionFactoryProvider.MIN_IDLE, 5, "minIdle"),
269269

270270
POOL_NAME(PoolingConnectionFactoryProvider.POOL_NAME, "testPool", "name"),
271271

0 commit comments

Comments
 (0)