Class RedisConfig

java.lang.Object
it.univr.passportease.config.RedisConfig

@Configuration public class RedisConfig extends Object
Redis configuration class. It is used to configure the connection to the Redis server and to create a RedisTemplate bean. Redis configuration is read from the application.properties file and the port is set to 6379 by default.
  • Field Details

    • redisHost

      @Value("${spring.data.redis.host}") private String redisHost
      Redis host.
  • Constructor Details

    • RedisConfig

      public RedisConfig()
  • Method Details

    • redisConnectionFactory

      @Bean public org.springframework.data.redis.connection.jedis.JedisConnectionFactory redisConnectionFactory()
      Creates a connection to the Redis server.
      Returns:
      JedisConnectionFactory, used to create a connection to the Redis server
    • redisTemplate

      @Bean public <T> org.springframework.data.redis.core.RedisTemplate<String,T> redisTemplate()
      Creates a RedisTemplate bean, used to interact with the Redis server.
      Type Parameters:
      T - Type of the RedisTemplate
      Returns:
      RedisTemplate, used to interact with the Redis server