v5.0.0
版本发布时间: 2023-09-03 17:41:09
redis/jedis最新发布版本:v5.0.2(2023-10-19 19:20:25)
What's New?
Automatic Cross-Cluster Failover
We're happy to introduce the Cross-Cluster Failover feature in Jedis. This feature provides high availability and resilience by allowing seamless transitions between Redis clusters during unforeseen failures or downtimes. It's a built-in tool to minimize manual intervention and downtime and ensure a more resilient application infrastructure. Learn more about how you can automate the failover process in our documentation.
Full Redis 7.2 and RESP3 Support
Examples to enable RESP3 are included later in this release note.
Changes
🔥 Breaking Changes (Listed here)
🚀 New Features
- Support RESP3 (#3293, #3387, #3388, #3389, #3403, #3507)
- Support Sharded PubSub (#3396)
- Introduce PipelineBase for Pipeline and multi node pipeline classes (#3437, #3442)
- 'double' timeout parameter for BLMPOP and BZMPOP commands (#3444)
🧪 Experimental Features
- Cross cluster failover (#3310)
- Allow setting default dialect for RediSearch module (#3452)
- Support JSON.MERGE command (#3429)
- Support TOPK.LIST with WITHCOUNT option (#3495)
🐛 Bug Fixes
- Fix return value of HRANDFIELD with values when count is negative (#3425, #3430)
- Return List instead of Set in ZDIFF, ZINTER, ZUNION commands (#3431)
🧰 Maintenance
- Deprecate RedisJSON v1 support (#3503)
- Deprecate RedisGraph support (#3504)
- Deprecate Sharding/Sharded feature (#3386)
- Bump org-json:json from 20230227 to 20230618 (#3472)
RESP3 Examples
This release introduces enabling RESP3 Redis connection, when the Redis server supports it.
- Enable RESP3 to a UnifiedJedis object:
import redis.clients.jedis.DefaultJedisClientConfig;
import redis.clients.jedis.HostAndPort;
import redis.clients.jedis.UnifiedJedis;
class DoResp3 {
public static void main() {
HostAndPort hnp = HostAndPort.from("localhost:6379");
UnifiedJedis c = UnifiedJedis(hnp, DefaultJedisClientConfig.builder().resp3().build());
c.set("foo", "value!");
c.get("foo");
}
}
- Enable RESP3 to a Jedis object:
import redis.clients.jedis.DefaultJedisClientConfig;
import redis.clients.jedis.HostAndPort;
import redis.clients.jedis.Jedis;
class DoResp3 {
public static void main() {
HostAndPort hnp = HostAndPort.from("localhost:6379");
Jedis c = Jedis(hnp, DefaultJedisClientConfig.builder().resp3().build());
c.set("foo", "value!");
c.get("foo");
}
}