What Is New in Jedis 3.2
This release focuses on enhancing Redis Cluster support and refining the API for better developer experience. It introduces new commands and addresses several bugs from previous versions.
| Category | Key Changes |
|---|---|
| New Features | Redis Cluster commands, new connection pool, ACL authentication. |
| Improvements | Refactored connection handling, URI parsing, and exception hierarchy. |
| Bug Fixes | Fixes for SSL, pipeline handling, and resource leaks. |
| Deprecations | Old constructors and specific methods marked for removal. |
What new Redis commands were added?
Jedis 3.2 adds support for several newer Redis commands, expanding its coverage of the Redis API. This is crucial for developers who need to use the latest features available in their Redis servers.
The update includes support for ZPOPMIN, ZPOPMAX, BGREWRITEAOF, and the CLIENT ID command. In practice, this means you can now use these operations directly through Jedis without resorting to generic command execution.
How is Cluster support improved?
Redis Cluster functionality received significant attention in this release. The improvements make working with distributed Redis setups more robust and intuitive.
Key changes include better handling of redirections (MOVED/ASK) and a more reliable cluster slot mapping refresh mechanism. This matters because it reduces the chance of commands failing with cluster-related exceptions during topology changes.
What changed with connection handling?
The internal connection handling was refactored for greater clarity and reliability. This low-level change impacts how Jedis manages its links to the Redis server.
The update introduces a clearer separation between connection creation, management, and pooling. For developers, this translates to more predictable behavior and easier debugging when dealing with connection-related issues.
Were there any breaking changes?
Yes, there are deprecations that signal future breaking changes. The developers are cleaning up the API by marking older methods for removal.
Specific deprecated items include certain old constructors and the Jedis.setDataSource method. You should update your code to use the recommended alternatives to ensure compatibility with future releases.
FAQ
Do I need to change my connection code for this update?
You might. If you're using the deprecated JedisPool constructors, you'll see warnings. Switch to using JedisPoolConfig and the updated constructors to avoid future breaks.
Is SSL connection handling more stable now?
Yes, several fixes address SSL handshake issues and connection timeouts. This should make SSL connections more reliable, especially in environments with strict network timeouts.
How does the new exception hierarchy affect error handling?
The refined exceptions make it easier to catch specific error types. Instead of generic exceptions, you can now catch more specific ones like JedisConnectionException or JedisDataException.
Were there any fixes for memory leaks?
Yes, a few resource leak issues were patched, particularly around connection objects not being properly returned to the pool in certain error scenarios. This helps with long-running application stability.
Does this release support Redis ACLs?
Yes, basic support for Redis 6 ACL authentication is included. You can now pass a username and password when creating connections for ACL-enabled Redis servers.