-
Notifications
You must be signed in to change notification settings - Fork 41.5k
Add support for static master-replica with Lettuce #46957
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for static master-replica with Lettuce #46957
Conversation
Thanks for the PR. Given that the static master-replica support is specific to Lettuce, I am not sure that the proposed additions should be as central to the auto-configuration as they currently are. For example, the properties could be nested beneath It also doesn't feel quite right for |
I agree. Would it still be consideration if the properties go beneath |
I'd definitely like to see the code in that form please. IMO, it would be an improvement on the current proposal and something that we'd certainly consider. |
@wilkinsona |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update. I've added a couple comments for you consideration.
I've also paged @mp911de for additional insights
if (staticMasterReplicaConfiguration != null) { | ||
return new LettuceConnectionFactory(staticMasterReplicaConfiguration, clientConfiguration); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the code move to a new Mode
value. It feels odd that there is a if check right before we switch over all the supported modes.
|
||
private final Cluster cluster = new Cluster(); | ||
|
||
private final StaticMasterReplica staticMasterReplica = new StaticMasterReplica(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we could name this Masterreplica
. Groups should not use camel case as we don't want hyphens in them.
See spring-projects/spring-data-redis#3218 - @mp911de mentionned we could also get rid of the |
@snicoll |
Let's go ahead with that option and we can revisit based on the code. |
0ccaa99
to
befbf86
Compare
Signed-off-by: 용현 <[email protected]>
Signed-off-by: 용현 <[email protected]>
Signed-off-by: 용현 <[email protected]>
befbf86
to
6175d90
Compare
@snicoll |
Yeah I agree but silently ignoring it if the nodes property is set isn't great either. Let's see if @mp911de has an opinion about that. |
It's a limitation of Jedis and it is what it is, so rejecting unsupported options is likely the best we can do.
|
@facewise FTR I am taking over as we need to figure out how to present this to the user. |
I've fixed formatting, checkstyle and a test that was broken. @facewise please run the build (on the command line) going forward before submitting something. Looking at the overall change, the SSL bundle can't be linked to the standalone config so I am looking at our options. |
See spring-projectsgh-46957 Signed-off-by: 용현 <[email protected]>
See gh-46957 Signed-off-by: 용현 <[email protected]>
Hi.
I'd like to suggest support for Redis static Master/Replica auto-configuration.
This auto-configuration makes
LettuceConnectionFactory
use RedisStaticMasterReplicaConfiguration, e.g. AWS ElastiCache with Replicas.I know it's cautious since Jedis doesn't support for static master-replica connection in Jedis, while Lettuce does.
Please feel free to review this suggestion and share your thoughts.