Class EmbeddedRedisAutoConfiguration


  • @ConditionalOnClass(name={"redis.embedded.RedisServer","org.springframework.data.redis.connection.RedisConnectionFactory"})
    @ConditionalOnProperty(name="bremersee.redis.embedded",
                           havingValue="true")
    @Configuration
    @AutoConfigureBefore(org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration.class)
    public class EmbeddedRedisAutoConfiguration
    extends Object
    The embedded redis auto configuration.
    Author:
    Christian Bremer
    • Constructor Detail

      • EmbeddedRedisAutoConfiguration

        public EmbeddedRedisAutoConfiguration()
    • Method Detail

      • embeddedRedisProperties

        @Bean
        @Primary
        public org.springframework.boot.autoconfigure.data.redis.RedisProperties embeddedRedisProperties()
        Overwrites the redis properties and sets host to 'localhost' and port to a random one.
        Returns:
        the redis properties
      • redisServer

        @Bean(initMethod="start",
              destroyMethod="stop")
        public redis.embedded.RedisServer redisServer​(org.springframework.boot.autoconfigure.data.redis.RedisProperties redisProperties)
                                               throws Exception
        Creates embedded redis server.
        Parameters:
        redisProperties - the redis properties
        Returns:
        the redis server
        Throws:
        Exception - the exception