Skip to content

Commit

Permalink
Polish "Set Lettuce shutdown timeout properly"
Browse files Browse the repository at this point in the history
  • Loading branch information
snicoll committed Jun 15, 2017
1 parent 0a9646d commit 053b8b5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ public void testDefaultRedisConfiguration() {
@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
Expand Down Expand Up @@ -121,16 +121,16 @@ public void testRedisConfigurationWithPool() throws Exception {
"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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 053b8b5

Please sign in to comment.