What Is New in Jedis 7.1
Jedis 7.1 delivers a focused set of enhancements and fixes, primarily improving the new UnifiedJedis API and connection handling. Here's a quick summary of the key changes.
| Category | Description |
|---|---|
| New Features | Support for Redis 7.2's HGETALL expansion and new command variants. |
| Improvements | Enhanced ConnectionPool validation and UnifiedJedis method coverage. |
| Bug Fixes | Resolved issues with connection timeouts, URI parsing, and cluster command routing. |
| Deprecated | Legacy JedisCluster constructor and specific method signatures. |
What are the new Redis 7.2 command additions?
Jedis 7.1 adds support for the new command variants introduced in Redis 7.2. The most significant addition is the
expanded HGETALL command, which now includes a WITHVALUES argument for more explicit
behavior.
This matters because it keeps the client in sync with the latest server capabilities. You can now use these new
command options directly through the UnifiedJedis interface without waiting for a future release.
How is connection pool validation improved?
The ConnectionPool class now includes a validateObject method. This provides a more
robust way to check if a connection is still valid before it's handed out from the pool to your application.
In practice, this helps prevent scenarios where your app might get a stale or broken connection, leading to unexpected timeout exceptions. It's a solid step towards more resilient connection management.
What got fixed for Cluster and Sentinel operations?
This release tackles a handful of pesky bugs in cluster and sentinel modes. One fix corrects connection timeout
handling when using the RedisProtocol. Another resolves an issue where SENTINEL MYID
wasn't being routed to the correct node in a Redis setup.
We also fixed a bug that prevented the use of the --user parameter in ACL-based connection URIs.
These fixes make working with distributed Redis deployments more predictable.
What methods were added to the UnifiedJedis interface?
The UnifiedJedis API, which is the future of Jedis, received several new method implementations.
This includes support for commands like ZINTERCARD, ZMPOP, and BZMPOP,
filling gaps in its coverage.
If you're migrating from the older, separate Jedis and JedisCluster classes, this makes
the transition smoother. You're less likely to find a missing method that forces you back to the legacy API.
What is being deprecated in this version?
Jedis 7.1 continues the deprecation of old patterns. The JedisCluster constructor that accepts a
Set of HostAndPort and a GenericObjectPoolConfig is now marked as
deprecated.
This push is all about standardizing on the JedisPooled and JedisCluster constructors
that use JedisClientConfig. It simplifies configuration and aligns with the unified connection
handling approach.
FAQ
Is the new HGETALL behavior in Jedis 7.1 backwards compatible?
Yes, the existing
hgetAll() method remains unchanged. The new Redis 7.2 behavior is accessed through different method
signatures, so your existing code won't break.
I use connection pools extensively. Should I update for the validation fix?
If you've
experienced issues with stale connections in your pool, this update is worthwhile. The new
validateObject method adds an extra layer of reliability for production environments.
Does the Sentinel MYID fix require any configuration changes?
No, the fix is entirely on the
client side. Your application will automatically route the command correctly without any changes to your code or
Sentinel configuration.
I'm still using the deprecated JedisCluster constructor. What should I do?
Start planning a
migration to the newer constructors that use JedisClientConfig. While the old constructor still
works, it will likely be removed in a future major version, so updating now is prudent.
Are there any performance improvements in this release?
This release is more about stability,
feature completeness, and fixes rather than raw performance gains. The connection pool validation improvement
could indirectly prevent performance hits from faulty connections.