Java Code Examples for org.springframework.data.redis.connection.RedisClusterConfiguration#setMaxRedirects()

The following examples show how to use org.springframework.data.redis.connection.RedisClusterConfiguration#setMaxRedirects() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AppConfig.java    From pcc-like with Apache License 2.0 5 votes vote down vote up
public RedisClusterConfiguration redisClusterConfiguration() {
	RedisClusterConfiguration clusterConfig = new RedisClusterConfiguration();
	clusterConfig.clusterNode(env.getProperty("spring.redis.host"),
			Integer.parseInt(env.getProperty("spring.redis.port")));
	clusterConfig.setMaxRedirects(10000);
	return clusterConfig;
}
 
Example 2
Source File: RedisConfUtils.java    From storm_spring_boot_demo with MIT License 5 votes vote down vote up
/**
 * {@link org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration#getClusterConfiguration}
 * @param redisProperties
 * @return
 */
public static RedisClusterConfiguration  getClusterConfiguration(RedisProperties redisProperties) {
    if (redisProperties.getCluster() == null) {
        return null;
    }
    RedisProperties.Cluster clusterProperties = redisProperties.getCluster();
    RedisClusterConfiguration config = new RedisClusterConfiguration(
            clusterProperties.getNodes());

    if (clusterProperties.getMaxRedirects() != null) {
        config.setMaxRedirects(clusterProperties.getMaxRedirects());
    }
    return config;
}
 
Example 3
Source File: ClusterInitializer.java    From spring-fu with Apache License 2.0 4 votes vote down vote up
@NotNull
private RedisClusterConfiguration getRedisClusterConfiguration() {
    final RedisClusterConfiguration configuration = new RedisClusterConfiguration(cluster.getNodes());
    configuration.setMaxRedirects(cluster.getMaxRedirects());
    return configuration;
}