diff options
Diffstat (limited to 'src/main/java/at/gv/egiz/moazs/RedisConfig.java')
-rw-r--r-- | src/main/java/at/gv/egiz/moazs/RedisConfig.java | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/src/main/java/at/gv/egiz/moazs/RedisConfig.java b/src/main/java/at/gv/egiz/moazs/RedisConfig.java deleted file mode 100644 index 321ec4a..0000000 --- a/src/main/java/at/gv/egiz/moazs/RedisConfig.java +++ /dev/null @@ -1,43 +0,0 @@ -package at.gv.egiz.moazs; - -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.data.redis.connection.RedisStandaloneConfiguration; -import org.springframework.data.redis.connection.jedis.JedisConnectionFactory; -import org.springframework.data.redis.core.RedisTemplate; -import org.springframework.data.redis.serializer.StringRedisSerializer; - -@Configuration -public class RedisConfig { - - public RedisConfig() { - } - - @Value("${spring.redis.host}") - private String host; - - @Value("${spring.redis.port}") - private int port; - - @Bean - JedisConnectionFactory jedisConnectionFactory() { - RedisStandaloneConfiguration config = new RedisStandaloneConfiguration(); - config.setHostName(host); - config.setPort(port); - return new JedisConnectionFactory(config); - } - - @Bean - public StringRedisSerializer stringRedisSerializer() { - return new StringRedisSerializer(); - } - - @Bean - public RedisTemplate<String, Object> redisTemplate() { - final RedisTemplate<String, Object> template = new RedisTemplate<String, Object>(); - template.setConnectionFactory(jedisConnectionFactory()); - template.setDefaultSerializer(stringRedisSerializer()); - return template; - } -} |