Skip to content

Conversation

@uglide
Copy link
Contributor

@uglide uglide commented Nov 6, 2025

Refined version of #4201

  • This PR introduces three new Redis client classes (RedisClient, RedisClusterClient, RedisSentinelClient) that provide a clean, developer-friendly API while addressing critical developer experience issues identified in the current Jedis architecture.
  • Old classes and public constructors of UnifiedJedis are marked as deprecated.

Deprecated Class Mappings

Deprecated Class Replacement Description
JedisPool RedisClient Pooled connection client for standalone Redis
JedisSentinelPool RedisSentinelClient Pooled connection client for Redis Sentinel
JedisPooled RedisClient Pooled connection client for standalone Redis
JedisSentineled RedisSentinelClient Client for Redis Sentinel deployments
JedisCluster RedisClusterClient Client for Redis Cluster deployments
JedisPoolConfig ConnectionPoolConfig Configuration class for connection pooling
JedisFactory (internal) Factory for pooled Jedis instances (no direct replacement needed)
UnifiedJedis (constructors) RedisClient / RedisSentinelClient / RedisClusterClient Use specific client classes instead of base class

@uglide uglide requested review from a-TODO-rov, atakavci, Copilot and ggivo and removed request for Copilot November 6, 2025 17:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new, cleaner client API for Jedis by creating three new client classes (RedisClient, RedisClusterClient, and RedisSentinelClient) that replace the legacy client classes (JedisPooled, JedisCluster, and JedisSentineled). The new classes use a builder pattern for advanced configuration while maintaining simple constructors for basic use cases.

  • Introduced new client classes with builder pattern support for flexible configuration
  • Deprecated legacy client classes and UnifiedJedis constructors with migration guidance
  • Updated internal references to use the new RedisClusterClient.INIT_NO_ERROR_PROPERTY constant
  • Added comprehensive integration tests demonstrating migration paths from legacy constructors

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
RedisClient.java New standalone Redis client with simple constructors and builder pattern support
RedisClusterClient.java New Redis Cluster client replacing JedisCluster with builder pattern
RedisSentinelClient.java New Redis Sentinel client replacing JedisSentineled
JedisPooled.java Added deprecation notice directing users to RedisClient
JedisCluster.java Added deprecation notice directing users to RedisClusterClient
JedisSentineled.java Added deprecation notice directing users to RedisSentinelClient
UnifiedJedis.java Deprecated multiple constructors and removed unused import
ClusterClientBuilder.java Removed generic type constraint to support both legacy and new cluster clients
ClusterConnectionProvider.java Updated INIT_NO_ERROR_PROPERTY reference to use RedisClusterClient
JedisClusterInfoCache.java Updated INIT_NO_ERROR_PROPERTY reference to use RedisClusterClient
RedisClusterClientMigrationIntegrationTest.java Comprehensive integration tests validating migration from JedisCluster to RedisClusterClient

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@uglide uglide force-pushed the im/introduce-new-client-classes branch 2 times, most recently from bf56e75 to be9dc0e Compare November 19, 2025 18:04
@github-actions
Copy link

github-actions bot commented Nov 20, 2025

Test Results

   283 files  +1     283 suites  +1   11m 40s ⏱️ -8s
10 455 tests +7  10 200 ✅ +1 018  255 💤  - 1 011  0 ❌ ±0 
 2 760 runs  +7   2 760 ✅ +    7    0 💤 ±    0  0 ❌ ±0 

Results for commit 85c881f. ± Comparison against base commit bce2ccc.

This pull request removes 1450 and adds 1457 tests. Note that renamed tests count towards both.
redis.clients.jedis.JedisClusterTest ‑ clusterLinks2
redis.clients.jedis.JedisClusterTest ‑ clusterPeriodTopologyRefreshTest
redis.clients.jedis.JedisClusterTest ‑ clusterRefreshNodes
redis.clients.jedis.JedisClusterTest ‑ testAskResponse
redis.clients.jedis.JedisClusterTest ‑ testAskResponseWithConfig
redis.clients.jedis.JedisClusterTest ‑ testCalculateConnectionPerSlot
redis.clients.jedis.JedisClusterTest ‑ testCloseable
redis.clients.jedis.JedisClusterTest ‑ testCloseableWithConfig
redis.clients.jedis.JedisClusterTest ‑ testClusterCountKeysInSlot
redis.clients.jedis.JedisClusterTest ‑ testClusterFlushSlots
…
redis.clients.jedis.RedisClientTest ‑ allowUrlWithNoDBAndNoPassword
redis.clients.jedis.RedisClientTest ‑ checkCloseableConnections
redis.clients.jedis.RedisClientTest ‑ checkPoolOverflow
redis.clients.jedis.RedisClientTest ‑ checkResourceWithConfig
redis.clients.jedis.RedisClientTest ‑ closeBrokenResourceTwice
redis.clients.jedis.RedisClientTest ‑ closeResourceTwice
redis.clients.jedis.RedisClientTest ‑ customClientName
redis.clients.jedis.RedisClientTest ‑ getNumActiveReturnsTheCorrectNumber
redis.clients.jedis.RedisClientTest ‑ getNumActiveWhenPoolIsClosed
redis.clients.jedis.RedisClientTest ‑ invalidClientName
…
This pull request removes 387 skipped tests and adds 66 skipped tests. Note that renamed tests count towards both.
redis.clients.jedis.commands.unified.pooled.PooledAllKindOfValuesCommandsTest[1] ‑ encodeCompleteResponseHgetallResp3
redis.clients.jedis.commands.unified.pooled.PooledAllKindOfValuesCommandsTest[1] ‑ encodeCompleteResponseXinfoStreamResp3
redis.clients.jedis.commands.unified.pooled.PooledAllKindOfValuesCommandsTest[1] ‑ restoreParams
redis.clients.jedis.commands.unified.pooled.PooledAllKindOfValuesCommandsTest[1] ‑ setGet_pxAt_ifdeq_then_delex
redis.clients.jedis.commands.unified.pooled.PooledAllKindOfValuesCommandsTest[1] ‑ setGet_px_ifdne_then_delex
redis.clients.jedis.commands.unified.pooled.PooledAllKindOfValuesCommandsTest[1] ‑ set_exAt_ifne_then_delex
redis.clients.jedis.commands.unified.pooled.PooledAllKindOfValuesCommandsTest[1] ‑ set_ex_ifeq_then_delex
redis.clients.jedis.commands.unified.pooled.PooledAllKindOfValuesCommandsTest[2] ‑ encodeCompleteResponseHgetallResp3
redis.clients.jedis.commands.unified.pooled.PooledAllKindOfValuesCommandsTest[2] ‑ encodeCompleteResponseXinfoStreamResp3
redis.clients.jedis.commands.unified.pooled.PooledAllKindOfValuesCommandsTest[2] ‑ restoreParams
…
redis.clients.jedis.commands.unified.client.RedisClientAllKindOfValuesCommandsTest[1] ‑ encodeCompleteResponseHgetallResp3
redis.clients.jedis.commands.unified.client.RedisClientAllKindOfValuesCommandsTest[1] ‑ encodeCompleteResponseXinfoStreamResp3
redis.clients.jedis.commands.unified.client.RedisClientAllKindOfValuesCommandsTest[1] ‑ restoreParams
redis.clients.jedis.commands.unified.client.RedisClientAllKindOfValuesCommandsTest[1] ‑ setGet_pxAt_ifdeq_then_delex
redis.clients.jedis.commands.unified.client.RedisClientAllKindOfValuesCommandsTest[1] ‑ setGet_px_ifdne_then_delex
redis.clients.jedis.commands.unified.client.RedisClientAllKindOfValuesCommandsTest[1] ‑ set_exAt_ifne_then_delex
redis.clients.jedis.commands.unified.client.RedisClientAllKindOfValuesCommandsTest[1] ‑ set_ex_ifeq_then_delex
redis.clients.jedis.commands.unified.client.RedisClientAllKindOfValuesCommandsTest[2] ‑ encodeCompleteResponseHgetallResp3
redis.clients.jedis.commands.unified.client.RedisClientAllKindOfValuesCommandsTest[2] ‑ encodeCompleteResponseXinfoStreamResp3
redis.clients.jedis.commands.unified.client.RedisClientAllKindOfValuesCommandsTest[2] ‑ restoreParams
…

♻️ This comment has been updated with latest results.

@uglide uglide force-pushed the im/introduce-new-client-classes branch from d401cac to 066e34c Compare November 20, 2025 11:03
Copy link
Collaborator

@ggivo ggivo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ggivo ggivo added the feature label Dec 17, 2025
@ggivo ggivo added this to the 7.2.0 milestone Dec 17, 2025
@ggivo ggivo merged commit b9d08c0 into master Dec 17, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants