Package org.bremersee.data.redis
Class EmbeddedRedisAutoConfiguration
- java.lang.Object
-
- org.bremersee.data.redis.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 Summary
Constructors Constructor Description EmbeddedRedisAutoConfiguration()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.boot.autoconfigure.data.redis.RedisProperties
embeddedRedisProperties()
Overwrites the redis properties and sets host to 'localhost' and port to a random one.redis.embedded.RedisServer
redisServer(org.springframework.boot.autoconfigure.data.redis.RedisProperties redisProperties)
Creates embedded redis server.
-
-
-
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
-
-