Closed
Description
UnifiedJedis and possibly other type constructors that accept a URI
and a JedisClientConfig
instantiate themselves with a mix of elements from both. This isn't unreasonable given that the URI can contain more than just host and port, but it isn't documented.
Options to fix it:
- Document the current behavior
- Update the constructors to let, for example, any config options win if both are specified, and document the behavior.
For example:
// works
UnifiedJedis jedis = new UnifiedJedis(new HostAndPort("localhost", 6379), DefaultJedisClientConfig.builder().user("username").password("password").build());
// also works
UnifiedJedis jedis2 = new UnifiedJedis(URI.create("redis://username:password@localhost:6379"));
// doesn't set auth correctly
UnifiedJedis ohNo = new UnifiedJedis(URI.create("redis://localhost:6379"), DefaultJedisClientConfig.builder().user("username").password("password").build());
See