Search in sources :

Example 1 with LettucePoolingClientConfiguration

use of org.springframework.data.redis.connection.lettuce.LettucePoolingClientConfiguration in project spring-cloud-connectors by spring-cloud.

the class RedisConnectionFactoryCloudConfigTestHelper method assertPoolProperties.

public static void assertPoolProperties(RedisConnectionFactory connector, int maxActive, int minIdle, long maxWait) {
    GenericObjectPoolConfig poolConfig = null;
    if (connector instanceof JedisConnectionFactory) {
        poolConfig = ((JedisConnectionFactory) connector).getPoolConfig();
    } else if (connector instanceof LettuceConnectionFactory) {
        LettuceClientConfiguration config = ((LettuceConnectionFactory) connector).getClientConfiguration();
        assertThat(config, instanceOf(LettucePoolingClientConfiguration.class));
        poolConfig = ((LettucePoolingClientConfiguration) config).getPoolConfig();
    }
    assertCommonsPoolProperties(poolConfig, maxActive, minIdle, maxWait);
}
Also used : GenericObjectPoolConfig(org.apache.commons.pool2.impl.GenericObjectPoolConfig) JedisConnectionFactory(org.springframework.data.redis.connection.jedis.JedisConnectionFactory) LettuceClientConfiguration(org.springframework.data.redis.connection.lettuce.LettuceClientConfiguration) LettuceConnectionFactory(org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory) LettucePoolingClientConfiguration(org.springframework.data.redis.connection.lettuce.LettucePoolingClientConfiguration)

Aggregations

GenericObjectPoolConfig (org.apache.commons.pool2.impl.GenericObjectPoolConfig)1 JedisConnectionFactory (org.springframework.data.redis.connection.jedis.JedisConnectionFactory)1 LettuceClientConfiguration (org.springframework.data.redis.connection.lettuce.LettuceClientConfiguration)1 LettuceConnectionFactory (org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory)1 LettucePoolingClientConfiguration (org.springframework.data.redis.connection.lettuce.LettucePoolingClientConfiguration)1