Files
spring-data-examples/redis/sentinel
Mark Paluch 45f19a6c1d #166 - Rename Redis cluster-sentinel to sentinel.
Rename the Redis cluster-sentinel project to sentinel and leave a hint in the cluster-sentinel directory that points to the Redis Cluster and Redis Sentinel examples mentioning clarifying the cluster-sentinel naming.
2017-03-10 08:47:19 +02: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;
	}

}