What Is New in Jedis 2.6
Jedis 2.6 delivers critical Redis 6 protocol support and significant internal refactoring. This update focuses on modernizing the client to handle new authentication and connection modes.
| Category | Key Changes |
|---|---|
| New Features | Redis 6 user/password ACL authentication, RESP3 protocol support (experimental) |
| Improvements | Refactored connection handling, connection pool changes, updated internal loggers |
| Bug Fixes | Pipeline synchronization, cluster command handling, URI parsing |
| Deprecated | Legacy constructors (Jedis(host, port, timeout)), old connection pool classes |
How does Jedis 2.6 handle Redis 6 ACLs?
Jedis 2.6 adds first-class support for Redis 6 Access Control Lists. You can now authenticate using a username and password combination, which is a major step up from the old single-password method.
The new auth method in the connection protocol handles this. In practice, you just pass the credentials in your connection string or via the client config.
jedis = new Jedis("redis://user:password@localhost:6379");
What's the deal with the RESP3 protocol?
RESP3 support is experimental in this release. It's the next-gen Redis serialization protocol that enables more complex data types and better client-server interactions.
You can enable it by setting the protocol version in your client configuration. This matters because it future-proofs your application for upcoming Redis features that will rely on RESP3's enhanced capabilities.
Why did the connection handling get refactored?
The core connection and protocol code underwent a significant cleanup. The goal was to untangle the logic for different connection types (standalone, cluster, sentinel) into separate classes.
This makes the codebase more maintainable and paves the way for future enhancements. You might notice some internal logger names changed because of this reorganization.
What changed with connection pools?
The pool implementation got updated to use the newer commons-pool2 components directly. The old JedisPool constructor that took host, port, and timeout parameters is now deprecated.
You should migrate to using JedisPoolConfig with JedisPool or the GenericObjectPoolConfig with the new pool implementation for better control and resource management.
FAQ
Is the RESP3 protocol support stable in Jedis 2.6?
No, it's explicitly marked as experimental in this release. It's safe to test but avoid using it in production until it's declared stable.
My code uses the old Jedis(host, port) constructor. Will it break?
Not immediately, but the constructors are now deprecated. You'll get compiler warnings. Start planning a migration to using connection URIs or the JedisShardInfo class.
How do I authenticate with a Redis 6 username and password?
Use the standard Redis URI format: redis://username:password@host:port. The client will automatically use the new AUTH command variant.
Were there any fixes for cluster mode operations?
Yes, several fixes address issues with executing commands across a Redis cluster, improving the reliability of operations in a clustered environment.
What should I use instead of the deprecated JedisPool constructors?
Switch to using the JedisPool constructor that accepts a JedisPoolConfig object and connection details, or use the newer pool implementations based on commons-pool2.