Files
spring-data-examples/redis/cluster-sentinel
Mark Paluch f4e874e601 #160 - Update docs for Redis cluster.
Mention Redis cluster example in the docs. Remove cluster wording from the sentinel example.
2016-03-18 16:28:47 +01:00
..
2016-02-27 12:30:31 +01:00

Spring Data Redis - Sentinel Examples

This project contains samples of Sentinel specific features of Spring Data Redis.

Support for Sentinel

@Configuration
public class RedisSentinelApplicationConfig {

	static final RedisSentinelConfiguration SENTINEL_CONFIG = new RedisSentinelConfiguration().master("mymaster") //
			.sentinel("localhost", 26379) //
			.sentinel("localhost", 26380) //
			.sentinel("localhost", 26381);

	@Bean
	public RedisConnectionFactory connectionFactory() {
		return new JedisConnectionFactory(sentinelConfig());
	}

	@Bean
	public RedisSentinelConfiguration sentinelConfig() {
		return SENTINEL_CONFIG;
	}

}