Skip to content

Add support for Jedis readOnlyForRedisClusterReplicas - #3445

Closed
hunseonglee wants to merge 1 commit into
spring-projects:mainfrom
hunseonglee:GH-2972
Closed

hunseonglee wants to merge 1 commit into
spring-projects:mainfrom
hunseonglee:GH-2972

Conversation

@hunseonglee

Copy link
Copy Markdown
Contributor

Exposes Jedis' readOnlyForRedisClusterReplicas client option through JedisClientConfiguration, as discussed in #2972 — the feature is now available in the released Jedis version this project builds against (8.0.1 provides DefaultJedisClientConfig.Builder#readOnlyForRedisClusterReplicas()).

Changes:

  • JedisClientConfiguration: new isReadOnlyForRedisClusterReplicas() (default false) and builder method readOnlyForRedisClusterReplicas(), following the existing builder style.
  • DefaultJedisClientConfiguration: carries the new flag.
  • JedisConnectionFactory#createClientConfig: propagates the flag to the underlying DefaultJedisClientConfig builder (before the client config customizer, so a customizer can still override).
  • Unit tests for the builder default/toggle and for propagation into the resulting JedisClientConfig (@Test // GH-2972).

I kept the interface method as a default returning false to stay compatible with external JedisClientConfiguration implementors — happy to make it abstract instead if you prefer, given getProtocol() took that route.

Closes #2972

Expose Jedis' readOnlyForRedisClusterReplicas client option through
JedisClientConfiguration so that read operations can be served by
Redis Cluster replica nodes. The flag is propagated to the underlying
DefaultJedisClientConfig when the connection factory creates its
client configuration.

Closes spring-projects#2972

Signed-off-by: seonghun lee <harrisleesh@gmail.com>
@mhalbritter

mhalbritter commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

We talked about that and decided that we don't need a dedicated API for that, as the customizer makes this "nice enough". Thanks for the PR anyway!

@mhalbritter mhalbritter added status: declined A suggestion or change that we don't feel we should currently apply and removed status: waiting-for-triage An issue we've not yet triaged labels Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: declined A suggestion or change that we don't feel we should currently apply

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Support to Jedis readOnlyForReplicas property

3 participants