Source:
public org.springframework.data.redis.connection.RedisConnectionFactory getObject() throws Exception { final LettuceConnectionFactory lettuceConnectionFactory; final String sentinelNodesProperty = readPropertyValue(propertyPrefix + "sentinel.nodes", String.class, ""); if (StringUtils.isBlank(sentinelNodesProperty)) { RedisStandaloneConfiguration standaloneConfiguration = new RedisStandaloneConfiguration(); standaloneConfiguration.setHostName(readPropertyValue(propertyPrefix + "host", String.class, "localhost")); standaloneConfiguration.setPort(readPropertyValue(propertyPrefix + "port", int.class, 6379)); standaloneConfiguration.setPassword(readPropertyValue(propertyPrefix + "password", String.class, null)); lettuceConnectionFactory = new LettuceConnectionFactory(standaloneConfiguration, buildLettuceClientConfiguration()); } else { List<String> sentinelNodes = Arrays.asList(sentinelNodesProperty.split(SENTINEL_HOST_SEPARATOR)); String redisMaster = readPropertyValue(propertyPrefix + "sentinel.master", String.class, "mymaster"); RedisSentinelConfiguration sentinelConfiguration = new RedisSentinelConfiguration(); sentinelConfiguration.master(redisMaster); sentinelNodes.stream() .map(HostAndPort::parse) .forEach(hostAndPort -> sentinelConfiguration.sentinel(hostAndPort.getHostText(), hostAndPort.getPort())); sentinelConfiguration.setSentinelPassword(readPropertyValue(propertyPrefix + "sentinel.password", String.class, null)); sentinelConfiguration.setPassword(readPropertyValue(propertyPrefix + "password", String.class, null)); lettuceConnectionFactory = new LettuceConnectionFactory(sentinelConfiguration, buildLettuceClientConfiguration()); } lettuceConnectionFactory.afterPropertiesSet(); return lettuceConnectionFactory; }

Target:
public org.springframework.data.redis.connection.RedisConnectionFactory getObject() throws Exception { final LettuceConnectionFactory lettuceConnectionFactory; if (isSentinelEnabled()) { logger.debug("Redis repository configured to use Sentinel connection"); List<HostAndPort> sentinelNodes = getSentinelNodes(); String redisMaster = readPropertyValue(propertyPrefix + SENTINEL_PARAMETER_PREFIX + "master", String.class); if (StringUtils.isBlank(redisMaster)) { throw new IllegalStateException("Incorrect Sentinel configuration : parameter '" + SENTINEL_PARAMETER_PREFIX + "master' is mandatory !"); } RedisSentinelConfiguration sentinelConfiguration = new RedisSentinelConfiguration(); sentinelConfiguration.master(redisMaster); sentinelNodes.forEach(hostAndPort -> sentinelConfiguration.sentinel(hostAndPort.getHostText(), hostAndPort.getPort())); sentinelConfiguration.setSentinelPassword(readPropertyValue(propertyPrefix + SENTINEL_PARAMETER_PREFIX + "password", String.class)); sentinelConfiguration.setPassword(readPropertyValue(propertyPrefix + "password", String.class)); lettuceConnectionFactory = new LettuceConnectionFactory(sentinelConfiguration, buildLettuceClientConfiguration()); } else { logger.debug("Redis repository configured to use standalone connection"); RedisStandaloneConfiguration standaloneConfiguration = new RedisStandaloneConfiguration(); standaloneConfiguration.setHostName(readPropertyValue(propertyPrefix + "host", String.class, "localhost")); standaloneConfiguration.setPort(readPropertyValue(propertyPrefix + "port", int.class, 6379)); standaloneConfiguration.setPassword(readPropertyValue(propertyPrefix + "password", String.class)); lettuceConnectionFactory = new LettuceConnectionFactory(standaloneConfiguration, buildLettuceClientConfiguration()); } lettuceConnectionFactory.afterPropertiesSet(); return lettuceConnectionFactory; }