Search in sources :

Example 26 with LettuceConnectionFactory

use of org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory in project pivotal-cla by pivotalsoftware.

the class SessionConfig method redisConnectionFactory.

@Bean
@ConditionalOnMissingBean(RedisConnectionFactory.class)
public RedisConnectionFactory redisConnectionFactory(RedisProperties redisProperties) {
    LettuceConnectionFactory connectionFactory = new LettuceConnectionFactory();
    connectionFactory.setPort(redisProperties.getPort());
    connectionFactory.setHostName(redisProperties.getHost());
    connectionFactory.setPassword(redisProperties.getPassword());
    connectionFactory.setShutdownTimeout(0);
    return connectionFactory;
}
Also used : LettuceConnectionFactory(org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 27 with LettuceConnectionFactory

use of org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory in project cu-kfs by CU-CommunityApps.

the class CacheConfiguration method connectionFactory.

@Bean
public RedisConnectionFactory connectionFactory(@Value("${redis.auth.token.password}") String redisAuthTokenPassword, @Value("${redis.host}") String redisHost, @Value("${redis.port}") int redisPort, @Value("${redis.use.ssl}") boolean redisUseSsl) {
    final LettuceConnectionFactory lettuceConnectionFactory = new LettuceConnectionFactory(redisHost, redisPort);
    lettuceConnectionFactory.setUseSsl(redisUseSsl);
    lettuceConnectionFactory.setPassword(redisAuthTokenPassword);
    return lettuceConnectionFactory;
}
Also used : LettuceConnectionFactory(org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory) Bean(org.springframework.context.annotation.Bean)

Aggregations

LettuceConnectionFactory (org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory)27 Test (org.junit.jupiter.api.Test)16 JedisConnectionFactory (org.springframework.data.redis.connection.jedis.JedisConnectionFactory)5 Bean (org.springframework.context.annotation.Bean)4 RedisStandaloneConfiguration (org.springframework.data.redis.connection.RedisStandaloneConfiguration)3 Test (org.junit.Test)2 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)2 ServiceConnectorCreationException (org.springframework.cloud.service.ServiceConnectorCreationException)2 LettuceClientConfiguration (org.springframework.data.redis.connection.lettuce.LettuceClientConfiguration)2 LettuceClientConfigurationBuilder (org.springframework.data.redis.connection.lettuce.LettuceClientConfiguration.LettuceClientConfigurationBuilder)2 LoadingCacheTest (com.alicp.jetcache.LoadingCacheTest)1 RefreshCacheTest (com.alicp.jetcache.RefreshCacheTest)1 AbstractExternalCacheTest (com.alicp.jetcache.test.external.AbstractExternalCacheTest)1 GenericObjectPoolConfig (org.apache.commons.pool2.impl.GenericObjectPoolConfig)1 ConfigurationPropertyFactoryBean (org.hisp.dhis.external.conf.ConfigurationPropertyFactoryBean)1 Pool (org.springframework.boot.autoconfigure.data.redis.RedisProperties.Pool)1 Cloud (org.springframework.cloud.Cloud)1 CloudFactory (org.springframework.cloud.CloudFactory)1 PooledServiceConnectorConfig (org.springframework.cloud.service.PooledServiceConnectorConfig)1 Profile (org.springframework.context.annotation.Profile)1