jedis/lettuce timeout

Lettuce

When we use Lettuce, we don’t need to configure the RedisConnectionFactory. Spring Boot does it for us.

All we have left, then, is to specify a few properties in our application.properties file:

1
2
3
4
5
6
spring.redis.database=0
spring.redis.host=localhost
spring.redis.port=16379
spring.redis.password=mypass
# timeout establishes the connection timeout
spring.redis.timeout=60000

jedis

  • JedisConnectionFactory.setTimeout
    ref: https://www.tabnine.com/code/java/methods/org.springframework.data.redis.connection.jedis.JedisConnectionFactory/setTimeout
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    @Bean
    public RedisConnectionFactory factory() {
    JedisConnectionFactory factory = new JedisConnectionFactory();
    factory.setDatabase(dateBase);
    factory.setHostName(host);
    factory.setPort(port);
    factory.setPassword(password);
    JedisPoolConfig poolConfig = new JedisPoolConfig();
    poolConfig.setMaxIdle(maxIdle);
    poolConfig.setMinIdle(minIdle);
    poolConfig.setMaxWaitMillis(maxWait);
    poolConfig.setMaxTotal(maxTotal);
    factory.setPoolConfig(poolConfig);
    factory.setTimeout(timeout);
    return factory;
    }
阅读更多

webflux springdoc-openapi

1
2
3
4
5
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-webflux-ui</artifactId>
<version>1.6.7</version>
</dependency>
阅读更多