Skip to content

Allow users to contribute a RedisStandaloneConfiguration bean #27990

@Peak-Song

Description

@Peak-Song

Hi, in my project, the redis password is gained from remote, so it cannot be configed in the application.yaml.
I use lettuce as the redis connector.

I have learned that in org.springframework.boot.autoconfigure.data.redis.LettuceConnectionConfiguration , its constructor contains ObjectProvider<RedisSentinelConfiguration> and ObjectProvider<RedisClusterConfiguration>, and more than that, in RedisConnectionConfiguration, getSentinelConfig() and getClusterConfiguration() injects the corresponding bean gained from provider in priority if available,
so in the scene of redis cluster or sentinel, I can provide my own RedisSentinelConfiguration or RedisClusterConfiguration in my own configuration class to set the password from remote.

However, in getStandaloneConfig(), I haven't seen the same action, then I'm pluzzled, is there an elegant way to gain password from remote for standalone redis? Have I miss something?

Thx.

dependency

  • springboot 2.5.4
  • lettuce.core 6.1.4
  • spring data redis 2.5.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions