RedisConfig.java 612 B

1234567891011121314151617
  1. package com.nokia.config;
  2. import org.springframework.context.annotation.Bean;
  3. import org.springframework.context.annotation.Configuration;
  4. import org.springframework.data.redis.connection.RedisConnectionFactory;
  5. import org.springframework.data.redis.core.RedisTemplate;
  6. @Configuration
  7. public class RedisConfig {
  8. @Bean
  9. public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory redisConnectionFactory) {
  10. RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>();
  11. redisTemplate.setConnectionFactory(redisConnectionFactory);
  12. return redisTemplate;
  13. }
  14. }