Polish "Set Lettuce shutdown timeout properly"
Closes gh-9526
This commit is contained in:
parent
0a9646dbf4
commit
053b8b5853
|
@ -73,14 +73,14 @@ public class RedisAutoConfigurationTests {
|
|||
@Test
|
||||
public void testOverrideRedisConfiguration() {
|
||||
load("spring.redis.host:foo", "spring.redis.database:1",
|
||||
"spring.redis.lettuce.shutdown-timeout:100");
|
||||
"spring.redis.lettuce.shutdown-timeout:500");
|
||||
LettuceConnectionFactory cf = this.context
|
||||
.getBean(LettuceConnectionFactory.class);
|
||||
assertThat(cf.getHostName()).isEqualTo("foo");
|
||||
assertThat(cf.getDatabase()).isEqualTo(1);
|
||||
assertThat(cf.getPassword()).isNull();
|
||||
assertThat(cf.isUseSsl()).isFalse();
|
||||
assertThat(cf.getShutdownTimeout()).isEqualTo(100);
|
||||
assertThat(cf.getShutdownTimeout()).isEqualTo(500);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -121,16 +121,16 @@ public class RedisAutoConfigurationTests {
|
|||
"spring.redis.lettuce.pool.max-idle:4",
|
||||
"spring.redis.lettuce.pool.max-active:16",
|
||||
"spring.redis.lettuce.pool.max-wait:2000",
|
||||
"spring.redis.lettuce.shutdown-timeout:100");
|
||||
"spring.redis.lettuce.shutdown-timeout:1000");
|
||||
LettuceConnectionFactory cf = this.context
|
||||
.getBean(LettuceConnectionFactory.class);
|
||||
assertThat(cf.getShutdownTimeout()).isEqualTo(100);
|
||||
assertThat(getDefaultLettucePool(cf).getHostName()).isEqualTo("foo");
|
||||
assertThat(getDefaultLettucePool(cf).getPoolConfig().getMinIdle()).isEqualTo(1);
|
||||
assertThat(getDefaultLettucePool(cf).getPoolConfig().getMaxIdle()).isEqualTo(4);
|
||||
assertThat(getDefaultLettucePool(cf).getPoolConfig().getMaxTotal()).isEqualTo(16);
|
||||
assertThat(getDefaultLettucePool(cf).getPoolConfig().getMaxWaitMillis())
|
||||
.isEqualTo(2000);
|
||||
assertThat(cf.getShutdownTimeout()).isEqualTo(1000);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -886,7 +886,7 @@ content into your application; rather pick only the properties that you need.
|
|||
spring.redis.lettuce.pool.max-idle=8 # Max number of "idle" connections in the pool. Use a negative value to indicate an unlimited number of idle connections.
|
||||
spring.redis.lettuce.pool.max-wait=-1 # Maximum amount of time (in milliseconds) a connection allocation should block before throwing an exception when the pool is exhausted. Use a negative value to block indefinitely.
|
||||
spring.redis.lettuce.pool.min-idle=0 # Target for the minimum number of idle connections to maintain in the pool. This setting only has an effect if it is positive.
|
||||
spring.redis.lettuce.shutdown-timeout=2000 # Shutdown timeout in milliseconds.
|
||||
spring.redis.lettuce.shutdown-timeout=100 # Shutdown timeout in milliseconds.
|
||||
spring.redis.password= # Login password of the redis server.
|
||||
spring.redis.port=6379 # Redis server port.
|
||||
spring.redis.sentinel.master= # Name of Redis server.
|
||||
|
|
Loading…
Reference in New Issue