static <K, V> RedisRetryTemplate<K, V> createRedisRetryTemplate(RedisConnectionFactory connectionFactory, Class<V> valueClass,
			RetryOperations retryOperations) {
		RedisRetryTemplate<K, V> redisTemplate = new RedisRetryTemplate<K, V>();
		redisTemplate.setKeySerializer(new StringRedisSerializer());
		redisTemplate.setValueSerializer(new GenericToStringSerializer<V>(valueClass));

		// avoids proxy
		redisTemplate.setExposeConnection(true);

		redisTemplate.setConnectionFactory(connectionFactory);
		redisTemplate.setRetryOperations(retryOperations);

		redisTemplate.afterPropertiesSet();
		return redisTemplate;
	}
Create a RedisRetryTemplate for a specific value class and serializer options.
@param connectionFactory the connection factory to use
@param valueClass the class to use for the {@link org.springframework.data.redis.serializer.RedisSerializer}
                  for values.
@param retryOperations
@param <K> the Redis key type against which the template works (usually a String)
@param <V> the Redis value type against which the template works
@return a newly instantiated RedisRetryTemplate
spring-xd-analytics/src/main/java/org/springframework/xd/analytics/metrics/redis/RedisUtils.java