Skip to content
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

Being able to do setCredentialsResolver at Config level #5838

Open
CyrilDevOps opened this issue May 3, 2024 · 0 comments
Open

Being able to do setCredentialsResolver at Config level #5838

CyrilDevOps opened this issue May 3, 2024 · 0 comments

Comments

@CyrilDevOps
Copy link

Is your feature request related to a problem? Please describe.
Hi,
We use basic redis single node in our dev, laptop station, but replicated or clustered redis (in AWS),
Today we need to do setCredentialsResolver at singleserver, replicatedserver, clusterserver level, which add complication when reading config from a yaml file.
Our application was just :
config = Config.fromYaml();
client = Redisson.Create(config);

Now when we want to use CredentialsResolver, it look more like :
String yaml = IOUtils.toString(stream from file ...)
config = Config.fromYaml(yaml)
if (yaml.contains("replicatedServersConfig")) {
config.useReplicatedServers().setCredentialsResolver(credentialsResolver.get());
} else if (yaml.contains("clusterServersConfig")) {
config.useClusterServers().setCredentialsResolver(credentialsResolver.get());
} else if (yaml.contains("singleServerConfig")) {
config.useSingleServer().setCredentialsResolver(credentialsResolver.get());
} ...
client = Redisson.Create(config);

Describe the solution you'd like
Because it isn't possible today with the 'Config' class to know what sort of redis server we are using,
I think we could add a setCredentialsResolver method at Config level, that would do the call to
'setCredentialsResolver' to the correct redis config type.

Describe alternatives you've considered

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

No branches or pull requests

1 participant