From cd80c81b2cbb22fe87bd35e68f08bad6570d5463 Mon Sep 17 00:00:00 2001 From: Igor Malinovskiy Date: Thu, 9 Oct 2025 11:55:34 +0200 Subject: [PATCH 1/8] Add migration guide for v7 --- docs/migration-guides/v6-to-v7.md | 255 ++++++++++++++++++++++++++++++ 1 file changed, 255 insertions(+) create mode 100644 docs/migration-guides/v6-to-v7.md diff --git a/docs/migration-guides/v6-to-v7.md b/docs/migration-guides/v6-to-v7.md new file mode 100644 index 0000000000..3fb0cd178a --- /dev/null +++ b/docs/migration-guides/v6-to-v7.md @@ -0,0 +1,255 @@ +# Jedis 7.0.0 Migration Guide + +This guide helps you migrate from Jedis 6.2.0 to Jedis 7.0.0. Version 7.0.0 includes several breaking changes focused on removing deprecated features and improving the API design. + +## Table of Contents + +- [Overview](#overview) +- [Breaking Changes](#breaking-changes) + - [Removed Deprecated Sharding/Sharded Features](#removed-deprecated-shardingsharded-features) + - [Base Class Changes](#base-class-changes) + - [UnifiedJedis Constructor Changes](#unifiedjedis-constructor-changes) + - [Return Type Changes](#return-type-changes) +- [New Features](#new-features) + - [Automatic Failover and Failback](#automatic-failover-and-failback) + - [Builder Pattern for Client Creation](#builder-pattern-for-client-creation) + +## Overview + +Jedis 7.0.0 is a major release that removes previously deprecated features and modernizes the API. The main focus areas are: + +1. **Removal of deprecated sharding features** - JedisSharding and related classes have been removed +2. **Base class consolidation** - Pipeline and Transaction base classes have been renamed +3. **Builder pattern introduction** - New fluent builders for JedisPooled, JedisCluster, and JedisSentineled +4. **API cleanup** - Removal of deprecated constructors and methods + +## Breaking Changes + +### Removed Deprecated Sharding Features + +The following classes and features have been **completely removed** in Jedis 7.0.0: + +#### Removed Classes + +- `JedisSharding` - Use `JedisCluster` for distributed Redis deployments instead +- `ShardedPipeline` - Use `Pipeline` with `JedisCluster` instead +- `ShardedConnectionProvider` - No replacement needed +- `ShardedCommandArguments` - Internal class, no replacement needed +- `ShardedCommandObjects` - Internal class, no replacement needed + +#### Migration Path + +If you were using `JedisSharding`: + +**Before (v6.2.0):** +```java +List shards = Arrays.asList( + new HostAndPort("localhost", 6379), + new HostAndPort("localhost", 6380) +); +JedisSharding jedisSharding = new JedisSharding(shards); +jedisSharding.set("key", "value"); +``` + +**After (v7.0.0):** +```java +// Option 1: Use JedisCluster for distributed deployments +Set nodes = new HashSet<>(Arrays.asList( + new HostAndPort("localhost", 6379), + new HostAndPort("localhost", 6380) +)); +JedisCluster jedisCluster = new JedisCluster(nodes); +jedisCluster.set("key", "value"); + +// Option 2: Use JedisPooled for single-node deployments +JedisPooled jedis = new JedisPooled("localhost", 6379); +jedis.set("key", "value"); +``` + +### Base Class Changes + +Several base classes have been renamed to better reflect their purpose: + +#### Pipeline Base Class + +- `PipelineBase` has been **removed** +- `Pipeline` now extends `AbstractPipeline` instead + +**Impact:** If you were using `PipelineBase` as a type reference, change it to `AbstractPipeline`. + +**Before (v6.2.0):** +```java +PipelineBase pipeline = jedis.pipelined(); +``` + +**After (v7.0.0):** +```java +AbstractPipeline pipeline = jedis.pipelined(); +// Or use the concrete type: +Pipeline pipeline = (Pipeline) jedis.pipelined(); +``` + +#### Transaction Base Class + +- `TransactionBase` has been **removed** +- `Transaction` now extends `AbstractTransaction` instead + +**Impact:** If you were using `TransactionBase` as a type reference, change it to `AbstractTransaction`. + +**Before (v6.2.0):** +```java +TransactionBase transaction = jedis.multi(); +``` + +**After (v7.0.0):** +```java +AbstractTransaction transaction = jedis.multi(); +// Or use the concrete type: +Transaction transaction = (Transaction) jedis.multi(); +``` + +### UnifiedJedis Constructor Changes + +Several deprecated constructors have been removed from `UnifiedJedis`: + +#### Removed Constructors + +1. **Cluster constructors with maxAttempts:** + ```java + // REMOVED in v7.0.0 + UnifiedJedis(Set nodes, JedisClientConfig config, int maxAttempts) + UnifiedJedis(Set nodes, JedisClientConfig config, int maxAttempts, Duration maxTotalRetriesDuration) + UnifiedJedis(Set nodes, JedisClientConfig config, GenericObjectPoolConfig poolConfig, int maxAttempts, Duration maxTotalRetriesDuration) + ``` + +2. **Sharding constructors:** + ```java + // REMOVED in v7.0.0 + UnifiedJedis(ShardedConnectionProvider provider) + UnifiedJedis(ShardedConnectionProvider provider, Pattern tagPattern) + ``` + +#### Migration Path + +**Before (v6.2.0):** +```java +Set nodes = new HashSet<>(); +nodes.add(new HostAndPort("localhost", 6379)); +JedisClientConfig config = DefaultJedisClientConfig.builder().build(); + +UnifiedJedis jedis = new UnifiedJedis(nodes, config, 3); +``` + +**After (v7.0.0):** +```java +Set nodes = new HashSet<>(); +nodes.add(new HostAndPort("localhost", 6379)); +JedisClientConfig config = DefaultJedisClientConfig.builder().build(); + +// Use JedisCluster instead +JedisCluster jedis = new JedisCluster(nodes, config); + +// Or use the new builder pattern +JedisCluster jedis = JedisCluster.builder() + .nodes(nodes) + .clientConfig(config) + .build(); +``` + +### Return Type Changes + +#### UnifiedJedis.pipelined() + +The return type has been changed to be more generic: + +**Before (v6.2.0):** +```java +PipelineBase pipelined() +``` + +**After (v7.0.0):** +```java +AbstractPipeline pipelined() +``` + +**Impact:** Minimal - `AbstractPipeline` is the parent class, so existing code should continue to work. + +## New Features + +### Automatic Failover and Failback + +Jedis 7.0.0 significantly refactors the automatic failover and failback API. If you were using the failover features in v6.2.0 with `MultiClusterClientConfig` and `MultiClusterPooledConnectionProvider`, these have been renamed and improved in v7.0.0. + +**Key Changes:** +- `MultiClusterClientConfig` → `MultiDbConfig` +- `MultiClusterPooledConnectionProvider` → `MultiDbConnectionProvider` +- New `MultiDbClient` class with builder pattern for easier configuration +- Enhanced health check strategies and configuration options + +**For detailed migration guidance on automatic failover and failback**, including: +- Complete migration examples from v6.x to v7.x +- Configuration options for retry and circuit breaker settings +- Health check strategies (EchoStrategy, LagAwareStrategy, custom strategies) +- Failback mechanisms and database selection API + +Please refer to the **[Automatic Failover and Failback Migration Guide](failover.md#migration-from-6x-to-7x)**. + +### Builder Pattern for Client Creation + +Jedis 7.0.0 introduces a fluent builder pattern for creating client instances, making configuration more intuitive and discoverable. + +#### JedisPooled Builder + +**New in v7.0.0:** +```java +JedisPooled jedis = JedisPooled.builder() + .host("localhost") + .port(6379) + .clientConfig(DefaultJedisClientConfig.builder() + .user("myuser") + .password("mypassword") + .database(0) + .build()) + .poolConfig(new GenericObjectPoolConfig<>()) + .build(); +``` + +#### JedisCluster Builder + +**New in v7.0.0:** +```java +Set nodes = new HashSet<>(); +nodes.add(new HostAndPort("localhost", 7000)); +nodes.add(new HostAndPort("localhost", 7001)); + +JedisCluster cluster = JedisCluster.builder() + .nodes(nodes) + .clientConfig(DefaultJedisClientConfig.builder() + .password("mypassword") + .build()) + .maxAttempts(5) + .maxTotalRetriesDuration(Duration.ofSeconds(10)) + .build(); +``` + +#### JedisSentineled Builder + +**New in v7.0.0:** +```java +Set sentinels = new HashSet<>(); +sentinels.add(new HostAndPort("localhost", 26379)); +sentinels.add(new HostAndPort("localhost", 26380)); + +JedisSentineled jedis = JedisSentineled.builder() + .masterName("mymaster") + .sentinels(sentinels) + .clientConfig(DefaultJedisClientConfig.builder() + .password("mypassword") + .build()) + .build(); +``` + +## Getting Help + +If you encounter issues during migration create an issue or [start a discussion](https://github.com/redis/jedis/discussions/new?category=q-a). + From 5340fb6421cea29b37d9fe2c9dd3e51b7c298fd5 Mon Sep 17 00:00:00 2001 From: Igor Malinovskiy Date: Thu, 9 Oct 2025 11:56:09 +0200 Subject: [PATCH 2/8] Move all migration guides to subfolder --- .../v3-to-v4-primitives.md} | 0 .../v3-to-v4-zset-list.md} | 0 docs/{3to4.md => migration-guides/v3-to-v4.md} | 8 ++++---- docs/{breaking-5.md => migration-guides/v4-to-v5.md} | 0 mkdocs.yml | 9 +++++---- 5 files changed, 9 insertions(+), 8 deletions(-) rename docs/{3to4-primitives.md => migration-guides/v3-to-v4-primitives.md} (100%) rename docs/{3to4-zset-list.md => migration-guides/v3-to-v4-zset-list.md} (100%) rename docs/{3to4.md => migration-guides/v3-to-v4.md} (95%) rename docs/{breaking-5.md => migration-guides/v4-to-v5.md} (100%) diff --git a/docs/3to4-primitives.md b/docs/migration-guides/v3-to-v4-primitives.md similarity index 100% rename from docs/3to4-primitives.md rename to docs/migration-guides/v3-to-v4-primitives.md diff --git a/docs/3to4-zset-list.md b/docs/migration-guides/v3-to-v4-zset-list.md similarity index 100% rename from docs/3to4-zset-list.md rename to docs/migration-guides/v3-to-v4-zset-list.md diff --git a/docs/3to4.md b/docs/migration-guides/v3-to-v4.md similarity index 95% rename from docs/3to4.md rename to docs/migration-guides/v3-to-v4.md index af1df0158e..226da12418 100644 --- a/docs/3to4.md +++ b/docs/migration-guides/v3-to-v4.md @@ -40,12 +40,12 @@ connection would go into an unusable state. - `JedisExhaustedPoolException` has been removed. A `JedisException` with a similar message is thrown instead. -- [Many sorted set methods](3to4-zset-list.md) return a Java `List` instead of a -`Set`. [See the complete list](3to4-zset-list.md). +- [Many sorted set methods](v3-to-v4-zset-list.md) return a Java `List` instead of a +`Set`. [See the complete list](v3-to-v4-zset-list.md). -- [Many methods return primitive values](3to4-primitives.md)) (`long`/`boolean`/`double` instead of +- [Many methods return primitive values](v3-to-v4-primitives.md)) (`long`/`boolean`/`double` instead of `Long`/`Boolean`/ - `Double`). [See the complete list](3to4-primitives.md). + `Double`). [See the complete list](v3-to-v4-primitives.md). - `scriptExists(byte[])` method now returns `Boolean` instead of `Long`. diff --git a/docs/breaking-5.md b/docs/migration-guides/v4-to-v5.md similarity index 100% rename from docs/breaking-5.md rename to docs/migration-guides/v4-to-v5.md diff --git a/mkdocs.yml b/mkdocs.yml index 33999b4c9b..409e9f6b7b 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -21,11 +21,12 @@ nav: - Home: index.md - Jedis Maven: jedis-maven.md - Migrating to newer versions: - - Jedis 5: breaking-5.md + - Jedis 7: migration-guides/v6-to-v7.md + - Jedis 5: migration-guides/v4-to-v5.md - Jedis 4: - - Breaking changes: 3to4.md - - Primitives: 3to4-primitives.md - - ZSET: 3to4-zset-list.md + - Breaking changes: migration-guides/v3-to-v4.md + - Primitives: migration-guides/v3-to-v4-primitives.md + - ZSET: migration-guides/v3-to-v4-zset-list.md - Using Jedis with ...: - Search: redisearch.md - JSON: redisjson.md From 51c61f0262ffb853ed4cb3b4269e1be46c813573 Mon Sep 17 00:00:00 2001 From: Igor Malinovskiy Date: Thu, 9 Oct 2025 11:57:03 +0200 Subject: [PATCH 3/8] Update readme: - Bump client version - Update list of supported Redis versions - Remove references to JedisPool - Remove reference to Google Group --- README.md | 38 +++++++------------------------------- 1 file changed, 7 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index b272b781be..cb0fb042fc 100644 --- a/README.md +++ b/README.md @@ -30,8 +30,9 @@ Are you looking for a high-level library to handle object mapping? See [redis-om The most recent version of this library supports redis version [7.2](https://github.com/redis/redis/blob/7.2/00-RELEASENOTES), [7.4](https://github.com/redis/redis/blob/7.4/00-RELEASENOTES), -[8.0](https://github.com/redis/redis/blob/8.0/00-RELEASENOTES) and -[8.2](https://github.com/redis/redis/blob/8.2/00-RELEASENOTES). +[8.0](https://github.com/redis/redis/blob/8.0/00-RELEASENOTES), +[8.2](https://github.com/redis/redis/blob/8.2/00-RELEASENOTES) and +[8.4](https://github.com/redis/redis/blob/8.4/00-RELEASENOTES) The table below highlights version compatibility of the most-recent library versions with Redis and JDK versions. Compatibility means communication features, and Redis command capabilities. @@ -53,7 +54,7 @@ To get started with Jedis, first add it as a dependency in your Java project. If redis.clients jedis - 6.2.0 + 7.0.0 ``` @@ -65,37 +66,13 @@ Next, you'll need to connect to Redis. Consider installing a redis server with d docker run -p 6379:6379 -it redis:latest ``` -For many applications, it's best to use a connection pool. You can instantiate a Jedis connection pool like so: - -```java -JedisPool pool = new JedisPool("localhost", 6379); -``` - -With a `JedisPool` instance, you can use a -[try-with-resources](https://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html) -block to get a connection and run Redis commands. - -Here's how to run a single [SET](https://redis.io/commands/set) command within a *try-with-resources* block: - -```java -try (Jedis jedis = pool.getResource()) { - jedis.set("clientName", "Jedis"); -} -``` - -`Jedis` instances implement most Redis commands. See the -[Jedis Javadocs](https://www.javadoc.io/doc/redis.clients/jedis/latest/redis/clients/jedis/Jedis.html) -for the complete list of supported commands. - -### Easier way of using connection pool - -Using a *try-with-resources* block for each command may be cumbersome, so you may consider using JedisPooled. +For many applications, it's best to use a connection pool. You can instantiate a JedisPooled like so: ```java JedisPooled jedis = new JedisPooled("localhost", 6379); ``` -Now you can send commands like sending from Jedis. +Now you can send commands: ```java jedis.sadd("planets", "Venus"); @@ -157,8 +134,7 @@ package](https://github.com/redis/jedis/tree/master/src/test/java/redis/clients/ If you run into trouble or have any questions, we're here to help! Hit us up on the [Redis Discord Server](http://discord.gg/redis) or -[Jedis GitHub Discussions](https://github.com/redis/jedis/discussions) or -[Jedis mailing list](http://groups.google.com/group/jedis_redis). +[Jedis GitHub Discussions](https://github.com/redis/jedis/discussions). ## Contributing From 646a37c29e5a6af275d714f6ab29e2fc835857a9 Mon Sep 17 00:00:00 2001 From: Igor Malinovskiy Date: Thu, 9 Oct 2025 11:58:50 +0200 Subject: [PATCH 4/8] Remove duplicated content in the migration guide --- docs/migration-guides/v6-to-v7.md | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/docs/migration-guides/v6-to-v7.md b/docs/migration-guides/v6-to-v7.md index 3fb0cd178a..1ad8b8da70 100644 --- a/docs/migration-guides/v6-to-v7.md +++ b/docs/migration-guides/v6-to-v7.md @@ -180,19 +180,7 @@ AbstractPipeline pipelined() Jedis 7.0.0 significantly refactors the automatic failover and failback API. If you were using the failover features in v6.2.0 with `MultiClusterClientConfig` and `MultiClusterPooledConnectionProvider`, these have been renamed and improved in v7.0.0. -**Key Changes:** -- `MultiClusterClientConfig` → `MultiDbConfig` -- `MultiClusterPooledConnectionProvider` → `MultiDbConnectionProvider` -- New `MultiDbClient` class with builder pattern for easier configuration -- Enhanced health check strategies and configuration options - -**For detailed migration guidance on automatic failover and failback**, including: -- Complete migration examples from v6.x to v7.x -- Configuration options for retry and circuit breaker settings -- Health check strategies (EchoStrategy, LagAwareStrategy, custom strategies) -- Failback mechanisms and database selection API - -Please refer to the **[Automatic Failover and Failback Migration Guide](failover.md#migration-from-6x-to-7x)**. +**For detailed migration guidance on automatic failover and failback** please refer to the **[Automatic Failover and Failback Migration Guide](failover.md#migration-from-6x-to-7x)**. ### Builder Pattern for Client Creation From d312f2b65e636ac4a097c845a7ebb258bdd87478 Mon Sep 17 00:00:00 2001 From: Igor Malinovskiy Date: Thu, 9 Oct 2025 12:04:54 +0200 Subject: [PATCH 5/8] Update README.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cb0fb042fc..e11c31752d 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ The most recent version of this library supports redis version [7.4](https://github.com/redis/redis/blob/7.4/00-RELEASENOTES), [8.0](https://github.com/redis/redis/blob/8.0/00-RELEASENOTES), [8.2](https://github.com/redis/redis/blob/8.2/00-RELEASENOTES) and -[8.4](https://github.com/redis/redis/blob/8.4/00-RELEASENOTES) +[8.4](https://github.com/redis/redis/blob/8.4/00-RELEASENOTES). The table below highlights version compatibility of the most-recent library versions with Redis and JDK versions. Compatibility means communication features, and Redis command capabilities. From 2e2c399f2259393fbd3048b376f3ea60d96dae45 Mon Sep 17 00:00:00 2001 From: Igor Malinovskiy Date: Thu, 9 Oct 2025 12:43:16 +0200 Subject: [PATCH 6/8] Add missing v5 to v6 migration guide --- docs/migration-guides/v5-to-v6.md | 261 ++++++++++++++++++++++++++++++ mkdocs.yml | 1 + 2 files changed, 262 insertions(+) create mode 100644 docs/migration-guides/v5-to-v6.md diff --git a/docs/migration-guides/v5-to-v6.md b/docs/migration-guides/v5-to-v6.md new file mode 100644 index 0000000000..183f518303 --- /dev/null +++ b/docs/migration-guides/v5-to-v6.md @@ -0,0 +1,261 @@ +# Jedis 6.0.0 Migration Guide + +This guide helps you migrate from Jedis 5.x to Jedis 6.0.0. Version 6.0.0 includes breaking changes focused on Redis 8.0 support, removal of deprecated modules, and improvements to the Search API. + +## Table of Contents + +- [Overview](#overview) +- [Breaking Changes](#breaking-changes) + - [Removed RedisGraph Support](#removed-redisgraph-support) + - [Removed Triggers and Functions (RedisGears v2)](#removed-triggers-and-functions-redisgears-v2) + - [Search Dialect Default Change](#search-dialect-default-change) + - [FT.PROFILE Return Type Change](#ftprofile-return-type-change) + - [COMMAND INFO Response Changes](#command-info-response-changes) +- [New Features](#new-features) + - [Redis 8.0 Support](#redis-80-support) + - [SslOptions for Advanced SSL Configuration](#ssloptions-for-advanced-ssl-configuration) + - [Token-Based Authentication](#token-based-authentication) + - [New Hash Commands](#new-hash-commands) + - [Search Warning Messages](#search-warning-messages) +- [Additional Resources](#additional-resources) + +## Overview + +Jedis 6.0.0 is a major release that adds Redis 8.0 support and removes deprecated features. The main focus areas are: + +1. **Redis 8.0 compatibility** - Full support for Redis 8.0 features including built-in JSON, Search, and TimeSeries +2. **Module deprecations** - Removal of RedisGraph and Triggers & Functions (RedisGears v2) support +3. **Search API improvements** - Default dialect change and enhanced profiling responses +4. **Security enhancements** - New SSL options and token-based authentication support + +## Breaking Changes + +### Removed RedisGraph Support + +RedisGraph module support has been completely removed from Jedis 6.0.0 as the module has been deprecated by Redis. + +#### Removed Classes and Interfaces + +All classes in the `redis.clients.jedis.graph` package have been removed: + +- `RedisGraphCommands` interface +- `RedisGraphPipelineCommands` interface +- `GraphCommandObjects` class +- `GraphCache`, `GraphProtocol`, `GraphQueryParams` classes +- `ResultSet`, `ResultSetBuilder`, `Record`, `Header`, `Statistics` classes +- All entity classes: `Edge`, `Node`, `Path`, `Point`, `Property`, `GraphEntity` + +### Removed Triggers and Functions (RedisGears v2) + +Support for Triggers and Functions (RedisGears v2) has been removed from Jedis 6.0.0. + +#### Removed Classes and Interfaces + +All classes in the `redis.clients.jedis.gears` package have been removed: + +- `RedisGearsCommands` interface +- `RedisGearsProtocol` class +- `TFunctionListParams`, `TFunctionLoadParams` classes +- Response classes: `FunctionInfo`, `FunctionStreamInfo`, `GearsLibraryInfo`, `StreamTriggerInfo`, `TriggerInfo` + +### Search Dialect Default Change + +**BREAKING:** The default search dialect has changed from server-side default to **DIALECT 2** (client-side override). + +#### Impact + +Starting with Jedis 6.0.0, all `FT.SEARCH` and `FT.AGGREGATE` commands automatically append `DIALECT 2` unless explicitly configured otherwise. This may affect query results if you were relying on DIALECT 1 behavior. + +#### Migration Path + +**Option 1: Accept DIALECT 2 (Recommended)** + +Review your search queries to ensure they work correctly with DIALECT 2. Most queries should work without changes. + +**Option 2: Revert to DIALECT 1** + +If you need to maintain DIALECT 1 behavior: + +```java +JedisPooled jedis = new JedisPooled("redis://localhost:6379"); + +// Set default dialect to 1 +jedis.setDefaultSearchDialect(1); + +// Now all search commands will use DIALECT 1 +SearchResult result = jedis.ftSearch("idx:products", "@category:electronics"); +``` + +### FT.PROFILE Return Type Change + +The return type of `FT.PROFILE` commands has changed from `Map` to a structured `ProfilingInfo` object. + +#### Changed Methods + +**Before (v5.x):** +```java +Map.Entry> ftProfileSearch( + String indexName, FTProfileParams profileParams, Query query); + +Map.Entry> ftProfileAggregate( + String indexName, FTProfileParams profileParams, AggregationBuilder aggr); +``` + +**After (v6.0.0):** +```java +Map.Entry ftProfileSearch( + String indexName, FTProfileParams profileParams, Query query); + +Map.Entry ftProfileAggregate( + String indexName, FTProfileParams profileParams, AggregationBuilder aggr); +``` + +### COMMAND INFO Response Changes + +The response format for `COMMAND INFO` has been updated to include subcommand details, making it compatible with Redis 7.0+ and Redis 8.0. + +#### Impact + +If you were parsing the `COMMAND INFO` response, you may need to update your code to handle the new structure that includes subcommand information. + +**Before (v5.x):** +```java +List commandInfo = jedis.commandInfo("SET"); +// Returns basic command information +``` + +**After (v6.0.0):** +```java +List commandInfo = jedis.commandInfo("SET"); +// Returns command information including subcommand details +// Compatible with Redis 7.0+ format +``` + +## New Features + +### Redis 8.0 Support + +Jedis 6.0.0 adds full support for Redis 8.0, which includes built-in support for: + +- **JSON** - Native JSON data type (previously RedisJSON module) +- **Search and Query** - Full-text search capabilities (previously RediSearch module) +- **TimeSeries** - Time-series data support (previously RedisTimeSeries module) + +**Example:** +```java +JedisPooled jedis = new JedisPooled("redis://localhost:6379"); + +// JSON operations (built-in in Redis 8.0) +jedis.jsonSet("user:1", Path2.of("$"), "{\"name\":\"John\",\"age\":30}"); +String json = jedis.jsonGet("user:1"); + +// Search operations (built-in in Redis 8.0) +jedis.ftCreate("idx:users", + FTCreateParams.createParams() + .on(IndexDataType.JSON) + .addPrefix("user:"), + TextField.of("$.name").as("name"), + NumericField.of("$.age").as("age")); + +SearchResult result = jedis.ftSearch("idx:users", "@name:John"); +``` + +### SslOptions for Advanced SSL Configuration + +A new `SslOptions` class provides advanced SSL/TLS configuration options for secure connections. + +**Features:** +- Custom keystore and truststore configuration +- SSL protocol selection +- SSL verification mode control +- SSL parameters customization + +**Example:** +```java +SslOptions sslOptions = SslOptions.builder() + .keystore(new File("/path/to/keystore.jks")) + .keystorePassword("keystorePassword".toCharArray()) + .truststore(new File("/path/to/truststore.jks")) + .truststorePassword("truststorePassword".toCharArray()) + .sslVerifyMode(SslVerifyMode.FULL) + .build(); + +JedisClientConfig config = DefaultJedisClientConfig.builder() + .ssl(true) + .sslOptions(sslOptions) + .build(); + +JedisPooled jedis = new JedisPooled("localhost", 6379, config); +``` + +### Token-Based Authentication + +Jedis 6.0.0 introduces support for token-based authentication, useful for cloud environments and managed Redis services. + +**Example:** +```java +// Token-based authentication with automatic token refresh +TokenCredentials tokenCredentials = new TokenCredentials("initial-token"); + +JedisClientConfig config = DefaultJedisClientConfig.builder() + .credentials(tokenCredentials) + .build(); + +JedisPooled jedis = new JedisPooled("localhost", 6379, config); + +// Token can be updated dynamically +tokenCredentials.updateToken("new-token"); +``` + +### New Hash Commands + +Support for new hash field expiration commands introduced in Redis 7.4: + +- `HGETDEL` - Get and delete a hash field +- `HGETEX` - Get a hash field with expiration options +- `HSETEX` - Set a hash field with expiration + +**Example:** +```java +// HSETEX - Set field with expiration +jedis.hsetex("user:1", 3600, "session", "abc123"); + +// HGETEX - Get field and update expiration +String session = jedis.hgetex("user:1", "session", + HGetExParams.hgetExParams().ex(7200)); + +// HGETDEL - Get and delete field +String oldSession = jedis.hgetdel("user:1", "session"); +``` + +### Search Warning Messages + +Search and aggregation queries now support warning messages in results, helping identify potential issues with queries. + +**Example:** +```java +SearchResult result = jedis.ftSearch("idx:products", "@name:laptop"); + +// Check for warnings +if (result.hasWarnings()) { + List warnings = result.getWarnings(); + warnings.forEach(warning -> + System.out.println("Search warning: " + warning)); +} +``` + +## Additional Resources + +- [Redis 8.0 Release Notes](https://github.com/redis/redis/blob/8.0/00-RELEASENOTES) +- [Redis Search Documentation](https://redis.io/docs/interact/search-and-query/) +- [Redis Query Dialects](https://redis.io/docs/interact/search-and-query/advanced-concepts/dialects/) + +## Getting Help + +If you encounter issues during migration: + +1. Check the [Jedis GitHub Issues](https://github.com/redis/jedis/issues) +2. Join the [Redis Discord](https://discord.gg/redis) +3. Review the [Jedis Javadocs](https://www.javadoc.io/doc/redis.clients/jedis/latest/) +4. Start a [Discussion](https://github.com/redis/jedis/discussions) + diff --git a/mkdocs.yml b/mkdocs.yml index 409e9f6b7b..b09d4daabc 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -22,6 +22,7 @@ nav: - Jedis Maven: jedis-maven.md - Migrating to newer versions: - Jedis 7: migration-guides/v6-to-v7.md + - Jedis 6: migration-guides/v5-to-v6.md - Jedis 5: migration-guides/v4-to-v5.md - Jedis 4: - Breaking changes: migration-guides/v3-to-v4.md From cd648ad10d72b1a036c509bdbaa5d2ac9620a9d5 Mon Sep 17 00:00:00 2001 From: Igor Malinovskiy Date: Thu, 9 Oct 2025 12:48:36 +0200 Subject: [PATCH 7/8] Fix broken link --- docs/migration-guides/v6-to-v7.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/migration-guides/v6-to-v7.md b/docs/migration-guides/v6-to-v7.md index 1ad8b8da70..5c328368d2 100644 --- a/docs/migration-guides/v6-to-v7.md +++ b/docs/migration-guides/v6-to-v7.md @@ -180,7 +180,7 @@ AbstractPipeline pipelined() Jedis 7.0.0 significantly refactors the automatic failover and failback API. If you were using the failover features in v6.2.0 with `MultiClusterClientConfig` and `MultiClusterPooledConnectionProvider`, these have been renamed and improved in v7.0.0. -**For detailed migration guidance on automatic failover and failback** please refer to the **[Automatic Failover and Failback Migration Guide](failover.md#migration-from-6x-to-7x)**. +**For detailed migration guidance on automatic failover and failback** please refer to the **[Automatic Failover and Failback Migration Guide](https://redis.github.io/jedis/failover/#migration-from-6x-to-7x)**. ### Builder Pattern for Client Creation From 75590c7837bdf9d48140bedb27cf7a848b23942d Mon Sep 17 00:00:00 2001 From: Igor Malinovskiy Date: Thu, 9 Oct 2025 12:55:23 +0200 Subject: [PATCH 8/8] Update outdated modules section in README --- README.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e11c31752d..e5e0280650 100644 --- a/README.md +++ b/README.md @@ -96,12 +96,10 @@ Now you can use the `JedisCluster` instance and send commands like you would wit jedis.sadd("planets", "Mars"); ``` -## Using Redis modules +## Support for Redis data types -Jedis includes support for [Redis modules](https://redis.io/docs/modules/) such as -[RedisJSON](https://redis.io/json/) and [RediSearch](https://redis.io/search/). - -See the [RedisJSON Jedis](https://redis.github.io/jedis/redisjson/) or [RediSearch Jedis](https://redis.github.io/jedis/redisearch/) for details. +Jedis includes support for all [Redis data types](https://redis.io/docs/latest/develop/data-types/) and features such as +[JSON](https://redis.io/docs/latest/develop/data-types/json/) and [VectorSets](https://redis.io/docs/latest/develop/data-types/vector-sets/). ## Failover