Skip to content

Migrate legacy Jedis Cluster API to UnifiedJedis - #3424

Closed
viktoriya-kutsarova wants to merge 4 commits into
spring-projects:mainfrom
viktoriya-kutsarova:topic/unified-jedis-cluster
Closed

viktoriya-kutsarova wants to merge 4 commits into
spring-projects:mainfrom
viktoriya-kutsarova:topic/unified-jedis-cluster

Conversation

@viktoriya-kutsarova

Copy link
Copy Markdown
Contributor

Follow-up to #3315, completing the UnifiedJedis migration for the cluster path.

The cluster command callbacks were still typed over Jedis, and the node resource provider still handed out Jedis instances, which is not a UnifiedJedis subtype. This PR moves the remaining cluster internals to UnifiedJedis and removes the last uses of the deprecated sendCommand API.

Changes

  • JedisClusterCommandCallback / JedisMultiKeyClusterCommandCallback now extend ClusterCommandCallback<UnifiedJedis, T> / MultiKeyClusterCommandCallback<UnifiedJedis, T>. Source-incompatible for subclasses that implemented callbacks against Jedis.
  • JedisClusterNodeResourceProvider returns a UnifiedJedisAdapter wrapping the node Connection instead of Jedis.
  • Commands missing on UnifiedJedis (CLUSTER *, BGREWRITEAOF, BGSAVE, SAVE, LASTSAVE, CONFIG RESETSTAT/REWRITE, TIME, CLIENT LIST/KILL, SHUTDOWN) use executeCommand(new CommandArguments(...)); all remaining sendCommand calls (deprecated since Jedis 7.4.0) are migrated as well.
  • Raw command replies are decoded through JedisConverters.
  • Cluster migrate now applies MigrateOption (COPY/REPLACE) via MigrateParams.
  • Cluster jsonMGet routes through the typed multi-key callback using the per-node client.

Testing

Existing integration suite passes against local cluster infrastructure; no new tests.

  • You have read the Spring Data contribution guidelines.
  • You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.
  • You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only).

Signed-off-by: viktoriya.kutsarova <viktoriya.kutsarova@redis.com>
Signed-off-by: viktoriya.kutsarova <viktoriya.kutsarova@redis.com>
…cks that expect UnifiedJedis.

Signed-off-by: viktoriya.kutsarova <viktoriya.kutsarova@redis.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Sep 1, 2026
Signed-off-by: viktoriya.kutsarova <viktoriya.kutsarova@redis.com>
@viktoriya-kutsarova
viktoriya-kutsarova force-pushed the topic/unified-jedis-cluster branch from fe7ab72 to 80d1cf1 Compare September 1, 2026 17:25
@viktoriya-kutsarova

viktoriya-kutsarova commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor Author

I was thinking we might also want to add a few lines in the upgrade guide regarding the change for the callbacks. If someone extended any of the callbacks, they would need to update them to use UnifiedJedis.

[[upgrading.3-to-4.jedis-cluster-callbacks]]
=== Jedis Cluster Command Callbacks

As of 4.2, `JedisClusterConnection.JedisClusterCommandCallback` and
`JedisClusterConnection.JedisMultiKeyClusterCommandCallback` extend `ClusterCommandCallback<UnifiedJedis, T>`
and `MultiKeyClusterCommandCallback<UnifiedJedis, T>` instead of their `Jedis`-typed variants.
Update custom callbacks to accept `UnifiedJedis`.
Commands without a `UnifiedJedis` method can be issued through `UnifiedJedis.executeCommand(CommandArguments)`.

@mp911de mp911de self-assigned this Sep 2, 2026
@mp911de mp911de added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Sep 2, 2026
@mp911de mp911de added this to the 4.2.0-M2 (2026.1.0) milestone Sep 2, 2026
@mp911de mp911de changed the title Migrate legacy Jedis Cluster API to UnifiedJedis/RedisClusterClient Migrate legacy Jedis Cluster API to UnifiedJedis Sep 15, 2026
@mp911de mp911de closed this in 604f881 Sep 15, 2026
mp911de added a commit that referenced this pull request Sep 15, 2026
Introduce JedisClusterCommandCallback and JedisInvoker methods to accept ProtocolCommand for executeCommand call wrapping.

See #3424
@mp911de

mp911de commented Sep 15, 2026

Copy link
Copy Markdown
Member

Thank you for your contribution. That's merged and polished now. I've updated the release notes accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: enhancement A general enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants