Map R2DBC Pool 'minIdle' property

Closes gh-32332
This commit is contained in:
Stephane Nicoll 2022-09-14 13:56:44 +02:00
parent 6d2a1d3f3b
commit 6fb70d143d
2 changed files with 3 additions and 1 deletions

View File

@ -244,6 +244,8 @@ public final class ConnectionFactoryBuilder {
.to(builder::maxIdleTime);
map.from(options.getValue(PoolingConnectionFactoryProvider.MAX_CREATE_CONNECTION_TIME)).as(this::toDuration)
.to(builder::maxCreateConnectionTime);
map.from(options.getValue(PoolingConnectionFactoryProvider.MIN_IDLE)).as(this::toInteger)
.to(builder::minIdle);
map.from(options.getValue(PoolingConnectionFactoryProvider.POOL_NAME)).as(this::toString).to(builder::name);
map.from(options.getValue(PoolingConnectionFactoryProvider.PRE_RELEASE)).to((function) -> builder
.preRelease((Function<? super Connection, ? extends Publisher<Void>>) function));

View File

@ -265,7 +265,7 @@ class ConnectionFactoryBuilderTests {
MAX_CREATE_CONNECTION_TIME(PoolingConnectionFactoryProvider.MAX_CREATE_CONNECTION_TIME, Duration.ofSeconds(10),
"maxCreateConnectionTime"),
MIN_IDLE(PoolingConnectionFactoryProvider.MIN_IDLE, 0, "minIdle"),
MIN_IDLE(PoolingConnectionFactoryProvider.MIN_IDLE, 5, "minIdle"),
POOL_NAME(PoolingConnectionFactoryProvider.POOL_NAME, "testPool", "name"),