I can see that the ConfigBuilder accepts a withPort, withHost and withPassword but it does not provide a withUser.
FYI have the following code to extract the details from the REDIS_PROVIDER_URL (compatible with Sidekiq)
final ConfigBuilder configBuilder = new ConfigBuilder();
try {
URI redisUrl = new URI(System.getProperty("REDIS_PROVIDER", "127.0.0.1"));
String redisHost = redisUrl.getHost();
int redisPort = redisUrl.getPort();
String redisUserInfo = redisUrl.getUserInfo();
if (redisHost != null) {
configBuilder.withHost(redisHost);
}
if (redisPort > -1) {
configBuilder.withPort(redisPort);
}
if (redisUserInfo != null) {
configBuilder.withPassword(redisUserInfo);
}
// need to split the UserInfo into username and password here and set it with:
// configBuilder.withUser(); and configBuilder.withUser();
}
catch (URISyntaxException e) {
System.err.println(e.toString());
System.exit(1);
}
final Config config = configBuilder.build();
I'm using RedisToGo and the Redis URL that I need to connect to is of the form:
I can see that the ConfigBuilder accepts a
withPort
,withHost
andwithPassword
but it does not provide awithUser
.FYI have the following code to extract the details from the REDIS_PROVIDER_URL (compatible with Sidekiq)