Search in sources :

Example 1 with LettucePoolingClientConfigurationBuilder

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

the class RedisLettuceClientConfigurer method configurePool.

private void configurePool(LettuceClientConfigurationBuilder clientConfiguration, PooledServiceConnectorConfig config) {
    if (config.getPoolConfig() != null) {
        GenericObjectPoolConfig poolConfig = new GenericObjectPoolConfig();
        BeanWrapper target = new BeanWrapperImpl(poolConfig);
        BeanWrapper source = new BeanWrapperImpl(config.getPoolConfig());
        Util.setCorrespondingProperties(target, source);
        ((LettucePoolingClientConfigurationBuilder) clientConfiguration).poolConfig(poolConfig);
    }
}
Also used : BeanWrapper(org.springframework.beans.BeanWrapper) BeanWrapperImpl(org.springframework.beans.BeanWrapperImpl) GenericObjectPoolConfig(org.apache.commons.pool2.impl.GenericObjectPoolConfig) LettucePoolingClientConfigurationBuilder(org.springframework.data.redis.connection.lettuce.LettucePoolingClientConfiguration.LettucePoolingClientConfigurationBuilder)

Aggregations

GenericObjectPoolConfig (org.apache.commons.pool2.impl.GenericObjectPoolConfig)1 BeanWrapper (org.springframework.beans.BeanWrapper)1 BeanWrapperImpl (org.springframework.beans.BeanWrapperImpl)1 LettucePoolingClientConfigurationBuilder (org.springframework.data.redis.connection.lettuce.LettucePoolingClientConfiguration.LettucePoolingClientConfigurationBuilder)1