What Is New in Jedis 4.1
Jedis 4.1 introduces key enhancements focused on new Redis commands, improved connection handling, and essential bug fixes. This release solidifies support for modern Redis features while refining the core client experience.
| Category | Key Changes |
|---|---|
| New Features | Support for ACL commands, JSON commands, and CLIENT NO-EVICT. |
| Improvements | Enhanced Sentinel connection logic and URI handling for Redis Cluster. |
| Bug Fixes | Fixes for connection resource leaks and pipeline execution errors. |
| Deprecated | Legacy constructors and methods marked for removal in future versions. |
What new Redis commands does Jedis 4.1 support?
Jedis 4.1 adds support for several important Redis command sets. This includes the full suite of ACL commands for user and permission management, the entire JSON data type command set, and the CLIENT NO-EVICT command for better memory management during eviction.
In practice, this means you can now use Jedis to manage user access control programmatically and work with JSON documents directly in Redis without needing workarounds. The JSON support is a big deal for developers building modern applications with structured data.
Example: Using JSON.SET
jedis.jsonSet("user:1", "{\"name\":\"John\", \"age\":30}");
Object result = jedis.jsonGet("user:1");
How did connection handling improve in this release?
The connection logic, particularly for Sentinel and Cluster setups, got significant upgrades. Jedis now handles Sentinel URI configurations more reliably and provides better error messages when connecting to Redis Cluster nodes.
This matters because connection issues are often the hardest to debug in production. The improved error reporting means you'll spend less time figuring out why your client can't connect to your Redis infrastructure, especially in complex distributed environments.
What critical bugs were fixed in Jedis 4.1?
This release addresses several important bugs including connection resource leaks and pipeline execution problems. The resource leak fix prevents situations where connections weren't properly returned to the pool, which could eventually exhaust available connections.
Another notable fix resolves issues with pipeline execution where certain commands weren't handling responses correctly. These fixes make the client more stable for production workloads where connection efficiency and reliable command execution are non-negotiable.
What's being deprecated in Jedis 4.1?
Several legacy constructors and methods have been marked as deprecated in this release. These include older ways of creating Jedis instances and some method signatures that have been replaced with better alternatives.
You should check your code for deprecation warnings when upgrading. The deprecated methods will likely be removed in Jedis 5.0, so it's good to start migrating to the newer APIs now rather than facing breaking changes later.
FAQ
Does Jedis 4.1 require a specific Redis version?
No, but to use the new JSON and ACL commands, you need Redis 6.0 or later. The client itself works with older Redis versions, but the new command support requires matching server capabilities.
Is there any breaking change in Jedis 4.1?
No breaking changes were introduced in this release. The deprecated methods still work but will generate warnings. You can upgrade from 4.0 without modifying your existing code.
How do I use the new ACL commands?
The ACL commands are available through the AccessControlCommands interface. You can create users, set permissions, and manage authentication directly from your Java code now.
Were there any performance improvements?
While not specifically focused on performance, the connection leak fixes prevent performance degradation over time. The pipeline execution fixes also ensure more reliable command processing.
Should I upgrade from Jedis 3.x directly to 4.1?
Yes, but review the changelog from 3.x to 4.0 first as there were breaking changes between those major versions. The 4.1 release is a safe upgrade from any 4.0 version.