What Is New in Jedis 5.1
Jedis 5.1 delivers key enhancements for Redis connectivity, focusing on new commands, improved cluster support, and essential bug fixes. This release solidifies the client's capabilities for modern Redis deployments.
| Category | Key Changes |
|---|---|
| New Features | Support for ACL DRYRUN, CLIENT NO-TOUCH, and other Redis 7.2 commands. |
| Cluster Support | Added support for the CLUSTER LINKS command and improved connection handling. |
| Bug Fixes | Resolved issues with JedisCluster pipeline and connection pool behavior. |
| Deprecations | Marked the old 'Pipeline' cluster commands as deprecated. |
Which new Redis commands are supported?
Jedis 5.1 adds support for several commands introduced in Redis 7.2. This keeps the client in sync with the latest server capabilities.
New Command Highlights
ACL DRYRUN: Test a user's permissions for a specific command without executing it.CLIENT NO-TOUCH: Prevents the client from being reset by the server's timeout settings.EXPIRETIMEandPEXPIRETIME: Retrieve the absolute Unix timestamp for a key's expiration.ZINTERCARDandZUNIONCARD: Get the cardinality of the intersection or union of sorted sets.
In practice, ACL DRYRUN is particularly useful for auditing and validating user permissions programmatically before actual command execution.
How is Redis Cluster support improved?
This release enhances cluster operations with a new command and crucial fixes for pipeline stability. Cluster management is now more robust and informative.
Cluster Enhancements
- Added support for the
CLUSTER LINKScommand to monitor node-to-node connections within the cluster. - Fixed a critical bug where
JedisClusterpipelines could fail to read responses correctly, ensuring data integrity. - Deprecated the legacy cluster pipeline commands (
cluster.pipelined()) in favor of the unifiedpipelined()method.
The fix for the pipeline response reading is a big deal because it prevents silent data mismatches and connection errors in high-throughput scenarios.
What connection management changes were made?
Connection handling has been refined with a focus on resource cleanup and pool behavior. These changes prevent resource leaks and improve application stability.
Connection Updates
- Fixed an issue where connections in the pool were not being properly validated before use, which could lead to stale connections.
- Ensured the
Connectionobject'sclose()method consistently cleans up all resources.
This matters for long-running applications where connection pool exhaustion can suddenly degrade performance or cause timeouts.
FAQ
Is Jedis 5.1 compatible with older Redis servers?
Yes, it maintains backward compatibility. The new Redis 7.2 commands will only work if you are running a Redis 7.2+ server.
What should I use instead of the deprecated cluster.pipelined()?
You should migrate to using the standard pipelined() method on your JedisCluster object. The API is unified and more reliable.
Why is the ACL DRYRUN command useful?
It allows you to test and verify user permissions for specific commands in your application's security logic without any risk of actually modifying data.
Was the bug fix for cluster pipelines a major issue?
Yes, it could cause pipelines to read incorrect responses, leading to wrong data being returned or unexpected exceptions. This fix is crucial for data accuracy.
Do I need to change my connection pool configuration?
No configuration changes are required. The fixes to connection validation and cleanup are internal improvements that work with your existing setup.